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

Unified Diff: chrome/browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc

Issue 561883006: Hide location icon bubble on 2nd click. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits. Created 6 years, 3 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 | « chrome/browser/ui/views/location_bar/location_icon_view.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/location_bar/location_icon_view_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc b/chrome/browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dab3fc0ba41de05a06ba71073e50d78a8d789067
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc
@@ -0,0 +1,52 @@
+// Copyright (c) 2014 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/views/location_bar/location_icon_view.h"
+
+#include "base/command_line.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
+#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
+#include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/interactive_test_utils.h"
+#include "ui/aura/window.h"
+
+namespace {
+
+typedef InProcessBrowserTest LocationIconViewTest;
+
+// Verify that clicking the location icon a second time hides the bubble.
+IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) {
+ BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
+ views::View* location_icon_view =
+ browser_view->GetToolbarView()->location_bar()->location_icon_view();
+ ASSERT_TRUE(location_icon_view);
+
+ // Verify that clicking once shows the location icon bubble.
+ scoped_refptr<content::MessageLoopRunner> runner1 =
+ new content::MessageLoopRunner;
+ ui_test_utils::MoveMouseToCenterAndPress(
+ location_icon_view,
+ ui_controls::LEFT,
+ ui_controls::DOWN | ui_controls::UP,
+ runner1->QuitClosure());
+ runner1->Run();
+
+ EXPECT_TRUE(WebsiteSettingsPopupView::IsPopupShowing());
+
+ // Verify that clicking again doesn't reshow it.
+ scoped_refptr<content::MessageLoopRunner> runner2 =
+ new content::MessageLoopRunner;
+ ui_test_utils::MoveMouseToCenterAndPress(
+ location_icon_view,
+ ui_controls::LEFT,
+ ui_controls::DOWN | ui_controls::UP,
+ runner2->QuitClosure());
+ runner2->Run();
+
+ EXPECT_FALSE(WebsiteSettingsPopupView::IsPopupShowing());
+}
+
+} // namespace
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_icon_view.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698