"Fossies" - the Fresh Open Source Software Archive

Member "brave-core-1.30.89/browser/ui/views/accelerator_table_unittest.cc" (10 Oct 2021, 900 Bytes) of package /linux/www/brave-core-1.30.89.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "accelerator_table_unittest.cc" see the Fossies "Dox" file reference documentation.

    1 /* Copyright (c) 2020 The Brave Authors. All rights reserved.
    2  * This Source Code Form is subject to the terms of the Mozilla Public
    3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
    4  * You can obtain one at http://mozilla.org/MPL/2.0/. */
    5 
    6 #include <vector>
    7 
    8 #include "brave/app/brave_command_ids.h"
    9 #include "chrome/browser/ui/views/accelerator_table.h"
   10 #include "testing/gtest/include/gtest/gtest.h"
   11 
   12 namespace {
   13 
   14 bool HasCommandID(int command_id) {
   15   const std::vector<AcceleratorMapping> accelerator_list(GetAcceleratorList());
   16   for (auto it = accelerator_list.begin(); it != accelerator_list.end(); ++it) {
   17     const AcceleratorMapping& entry = *it;
   18     if (entry.command_id == command_id)
   19       return true;
   20   }
   21   return false;
   22 }
   23 
   24 }  // namespace
   25 
   26 TEST(AcceleratorTableTest, CheckBraveAccelerators) {
   27   EXPECT_TRUE(HasCommandID(IDC_NEW_OFFTHERECORD_WINDOW_TOR));
   28 }