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

Side by Side Diff: chrome/browser/chromeos/compact_location_bar_host_browsertest.cc

Issue 1591004: RunAllPendingEvents -> ui_test_utils::RunAllPendingInMessageLoop (Closed)
Patch Set: " Created 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/compact_navigation_bar_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/automation/ui_controls.h" 5 #include "chrome/browser/automation/ui_controls.h"
6 #include "chrome/browser/browser.h" 6 #include "chrome/browser/browser.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/compact_location_bar_host.h" 8 #include "chrome/browser/chromeos/compact_location_bar_host.h"
9 #include "chrome/browser/chromeos/frame/browser_view.h" 9 #include "chrome/browser/chromeos/frame/browser_view.h"
10 #include "chrome/browser/chromeos/view_ids.h" 10 #include "chrome/browser/chromeos/view_ids.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return clb_host()->IsCurrentTabIndex(index); 46 return clb_host()->IsCurrentTabIndex(index);
47 } 47 }
48 48
49 private: 49 private:
50 DISALLOW_COPY_AND_ASSIGN(CompactLocationBarHostTest); 50 DISALLOW_COPY_AND_ASSIGN(CompactLocationBarHostTest);
51 }; 51 };
52 52
53 IN_PROC_BROWSER_TEST_F(CompactLocationBarHostTest, TestCtrlLOpen) { 53 IN_PROC_BROWSER_TEST_F(CompactLocationBarHostTest, TestCtrlLOpen) {
54 // ctrl-l should not open compact location bar in normal mode. 54 // ctrl-l should not open compact location bar in normal mode.
55 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false); 55 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false);
56 RunAllPendingEvents(); 56 ui_test_utils::RunAllPendingInMessageLoop();
57 EXPECT_TRUE(IsCurrentTabIndex(-1)); 57 EXPECT_TRUE(IsCurrentTabIndex(-1));
58 EXPECT_FALSE(clb_host()->IsVisible()); 58 EXPECT_FALSE(clb_host()->IsVisible());
59 59
60 browser()->ToggleCompactNavigationBar(); 60 browser()->ToggleCompactNavigationBar();
61 RunAllPendingEvents(); 61 ui_test_utils::RunAllPendingInMessageLoop();
62 EXPECT_TRUE(IsCurrentTabIndex(-1)); 62 EXPECT_TRUE(IsCurrentTabIndex(-1));
63 EXPECT_FALSE(clb_host()->IsVisible()); 63 EXPECT_FALSE(clb_host()->IsVisible());
64 64
65 // ctrl-l should not open compact location bar in compact nav mode. 65 // ctrl-l should not open compact location bar in compact nav mode.
66 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false); 66 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false);
67 RunAllPendingEvents(); 67 ui_test_utils::RunAllPendingInMessageLoop();
68 EXPECT_TRUE(IsCurrentTabIndex(0)); 68 EXPECT_TRUE(IsCurrentTabIndex(0));
69 EXPECT_TRUE(clb_host()->IsVisible()); 69 EXPECT_TRUE(clb_host()->IsVisible());
70 70
71 // Esc to close it. 71 // Esc to close it.
72 ui_controls::SendKeyPress(window(), base::VKEY_ESCAPE, false, false, false); 72 ui_controls::SendKeyPress(window(), base::VKEY_ESCAPE, false, false, false);
73 RunAllPendingEvents(); 73 ui_test_utils::RunAllPendingInMessageLoop();
74 EXPECT_TRUE(IsCurrentTabIndex(0)); 74 EXPECT_TRUE(IsCurrentTabIndex(0));
75 EXPECT_FALSE(clb_host()->IsVisible()); 75 EXPECT_FALSE(clb_host()->IsVisible());
76 } 76 }
77 77
78 IN_PROC_BROWSER_TEST_F(CompactLocationBarHostTest, TestOnNewTab) { 78 IN_PROC_BROWSER_TEST_F(CompactLocationBarHostTest, TestOnNewTab) {
79 browser()->ToggleCompactNavigationBar(); 79 browser()->ToggleCompactNavigationBar();
80 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false); 80 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false);
81 RunAllPendingEvents(); 81 ui_test_utils::RunAllPendingInMessageLoop();
82 EXPECT_TRUE(IsCurrentTabIndex(0)); 82 EXPECT_TRUE(IsCurrentTabIndex(0));
83 EXPECT_TRUE(clb_host()->IsVisible()); 83 EXPECT_TRUE(clb_host()->IsVisible());
84 84
85 browser()->NewTab(); 85 browser()->NewTab();
86 RunAllPendingEvents(); 86 ui_test_utils::RunAllPendingInMessageLoop();
87
88 // See http://crbug.com/39858 for details.
87 //EXPECT_FALSE(clb_host()->IsVisible()); 89 //EXPECT_FALSE(clb_host()->IsVisible());
88 90
89 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false); 91 ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false);
90 RunAllPendingEvents(); 92 ui_test_utils::RunAllPendingInMessageLoop();
91 EXPECT_TRUE(IsCurrentTabIndex(1)); 93 EXPECT_TRUE(IsCurrentTabIndex(1));
92 EXPECT_TRUE(clb_host()->IsVisible()); 94 EXPECT_TRUE(clb_host()->IsVisible());
93 } 95 }
94 96
95 } // namespace chromeos 97 } // namespace chromeos
96
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/compact_navigation_bar_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698