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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc

Issue 2374253002: Fix bookmark bubble/star view highlighting for Harmony. (Closed)
Patch Set: fix tests, move bubble creation to toolbar Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/ui/views/frame/browser_view.h" 8 #include "chrome/browser/ui/views/frame/browser_view.h"
9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
10 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" 10 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
11 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h " 11 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h "
12 #include "chrome/test/base/in_process_browser_test.h" 12 #include "chrome/test/base/in_process_browser_test.h"
13 #include "chrome/test/base/interactive_test_utils.h" 13 #include "chrome/test/base/interactive_test_utils.h"
14 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
15 15
16 namespace { 16 namespace {
17 17
18 typedef InProcessBrowserTest LocationIconViewTest; 18 typedef InProcessBrowserTest LocationIconViewTest;
19 19
20 // Verify that clicking the location icon a second time hides the bubble. 20 // Verify that clicking the location icon a second time hides the bubble.
21 IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) { 21 IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) {
22 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); 22 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
23 views::View* location_icon_view = 23 views::View* location_icon_view =
24 browser_view->GetToolbarView()->location_bar()->location_icon_view(); 24 browser_view->toolbar()->location_bar()->location_icon_view();
25 ASSERT_TRUE(location_icon_view); 25 ASSERT_TRUE(location_icon_view);
26 26
27 // Verify that clicking once shows the location icon bubble. 27 // Verify that clicking once shows the location icon bubble.
28 scoped_refptr<content::MessageLoopRunner> runner1 = 28 scoped_refptr<content::MessageLoopRunner> runner1 =
29 new content::MessageLoopRunner; 29 new content::MessageLoopRunner;
30 ui_test_utils::MoveMouseToCenterAndPress( 30 ui_test_utils::MoveMouseToCenterAndPress(
31 location_icon_view, 31 location_icon_view,
32 ui_controls::LEFT, 32 ui_controls::LEFT,
33 ui_controls::DOWN | ui_controls::UP, 33 ui_controls::DOWN | ui_controls::UP,
34 runner1->QuitClosure()); 34 runner1->QuitClosure());
35 runner1->Run(); 35 runner1->Run();
36 36
37 EXPECT_TRUE(WebsiteSettingsPopupView::IsPopupShowing()); 37 EXPECT_TRUE(WebsiteSettingsPopupView::IsPopupShowing());
38 38
39 // Verify that clicking again doesn't reshow it. 39 // Verify that clicking again doesn't reshow it.
40 scoped_refptr<content::MessageLoopRunner> runner2 = 40 scoped_refptr<content::MessageLoopRunner> runner2 =
41 new content::MessageLoopRunner; 41 new content::MessageLoopRunner;
42 ui_test_utils::MoveMouseToCenterAndPress( 42 ui_test_utils::MoveMouseToCenterAndPress(
43 location_icon_view, 43 location_icon_view,
44 ui_controls::LEFT, 44 ui_controls::LEFT,
45 ui_controls::DOWN | ui_controls::UP, 45 ui_controls::DOWN | ui_controls::UP,
46 runner2->QuitClosure()); 46 runner2->QuitClosure());
47 runner2->Run(); 47 runner2->Run();
48 48
49 EXPECT_FALSE(WebsiteSettingsPopupView::IsPopupShowing()); 49 EXPECT_FALSE(WebsiteSettingsPopupView::IsPopupShowing());
50 } 50 }
51 51
52 } // namespace 52 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/keyboard_access_browsertest.cc ('k') | chrome/browser/ui/views/location_bar/star_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698