Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(876)

Unified Diff: chrome/browser/ui/views/find_bar_controller_interactive_uitest.cc

Issue 1622433002: views: Remove unused GetCurrentTargetForAccelerator from FocusManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/accelerators/focus_manager_factory.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/find_bar_controller_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/find_bar_controller_interactive_uitest.cc b/chrome/browser/ui/views/find_bar_controller_interactive_uitest.cc
deleted file mode 100644
index bc57b79716c9dbf37737aae1375a95d3cab297a8..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/views/find_bar_controller_interactive_uitest.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/find_bar/find_bar_controller.h"
-
-#include "base/files/file_path.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "ui/base/accelerators/accelerator.h"
-#include "ui/views/focus/focus_manager.h"
-#include "ui/views/widget/widget.h"
-#include "url/gurl.h"
-
-namespace {
-
-const char kSimple[] = "simple.html";
-
-GURL GetURL(const std::string& filename) {
- return ui_test_utils::GetTestUrl(base::FilePath().AppendASCII("find_in_page"),
- base::FilePath().AppendASCII(filename));
-}
-
-class FindBarControllerTest : public InProcessBrowserTest {
- public:
- FindBarControllerTest() {
- chrome::DisableFindBarAnimationsDuringTesting(true);
- }
-};
-
-// Make sure Find box grabs the Esc accelerator and restores it again.
-IN_PROC_BROWSER_TEST_F(FindBarControllerTest, AcceleratorRestoring) {
- // First we navigate to any page.
- ui_test_utils::NavigateToURL(browser(), GetURL(kSimple));
-
- gfx::NativeWindow window = browser()->window()->GetNativeWindow();
- views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
- views::FocusManager* focus_manager = widget->GetFocusManager();
-
- // See where Escape is registered.
- ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE);
- ui::AcceleratorTarget* old_target =
- focus_manager->GetCurrentTargetForAccelerator(escape);
- EXPECT_TRUE(old_target != NULL);
-
- chrome::ShowFindBar(browser());
-
- // Our Find bar should be the new target.
- ui::AcceleratorTarget* new_target =
- focus_manager->GetCurrentTargetForAccelerator(escape);
-
- EXPECT_TRUE(new_target != NULL);
- EXPECT_NE(new_target, old_target);
-
- // Close the Find box.
- browser()->GetFindBarController()->EndFindSession(
- FindBarController::kKeepSelectionOnPage,
- FindBarController::kKeepResultsInFindBox);
-
- // The accelerator for Escape should be back to what it was before.
- EXPECT_EQ(old_target,
- focus_manager->GetCurrentTargetForAccelerator(escape));
-
- // Show find bar again with animation on, and the target should be on
- // find bar.
- chrome::DisableFindBarAnimationsDuringTesting(false);
- chrome::ShowFindBar(browser());
- EXPECT_EQ(new_target,
- focus_manager->GetCurrentTargetForAccelerator(escape));
-}
-
-} // namespace
« no previous file with comments | « ash/accelerators/focus_manager_factory.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698