OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/location.h" | 5 #include "base/location.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 EXPECT_FALSE(action_view->IsMenuRunningForTesting()); | 263 EXPECT_FALSE(action_view->IsMenuRunningForTesting()); |
264 // We should have navigated to the extension's home page, which is google.com. | 264 // We should have navigated to the extension's home page, which is google.com. |
265 EXPECT_EQ( | 265 EXPECT_EQ( |
266 GURL("https://www.google.com/"), | 266 GURL("https://www.google.com/"), |
267 browser()->tab_strip_model()->GetActiveWebContents()->GetVisibleURL()); | 267 browser()->tab_strip_model()->GetActiveWebContents()->GetVisibleURL()); |
268 } | 268 } |
269 | 269 |
270 // Tests that clicking on the toolbar action a second time when the action is | 270 // Tests that clicking on the toolbar action a second time when the action is |
271 // already open results in closing the popup, and doesn't re-open it. | 271 // already open results in closing the popup, and doesn't re-open it. |
| 272 #if defined(OS_WIN) |
| 273 // Flaky on Windows; see https://crbug.com/617056. |
| 274 #define MAYBE_DoubleClickToolbarActionToClose \ |
| 275 DISABLED_DoubleClickToolbarActionToClose |
| 276 #else |
| 277 #define MAYBE_DoubleClickToolbarActionToClose DoubleClickToolbarActionToClose |
| 278 #endif |
272 IN_PROC_BROWSER_TEST_F(ToolbarActionViewInteractiveUITest, | 279 IN_PROC_BROWSER_TEST_F(ToolbarActionViewInteractiveUITest, |
273 DoubleClickToolbarActionToClose) { | 280 MAYBE_DoubleClickToolbarActionToClose) { |
274 ASSERT_TRUE(LoadExtension( | 281 ASSERT_TRUE(LoadExtension( |
275 test_data_dir_.AppendASCII("ui").AppendASCII("browser_action_popup"))); | 282 test_data_dir_.AppendASCII("ui").AppendASCII("browser_action_popup"))); |
276 base::RunLoop().RunUntilIdle(); // Ensure the extension is fully loaded. | 283 base::RunLoop().RunUntilIdle(); // Ensure the extension is fully loaded. |
277 | 284 |
278 BrowserActionsContainer* browser_actions_container = | 285 BrowserActionsContainer* browser_actions_container = |
279 BrowserView::GetBrowserViewForBrowser(browser()) | 286 BrowserView::GetBrowserViewForBrowser(browser()) |
280 ->toolbar() | 287 ->toolbar() |
281 ->browser_actions(); | 288 ->browser_actions(); |
282 ToolbarActionsBar* toolbar_actions_bar = | 289 ToolbarActionsBar* toolbar_actions_bar = |
283 browser_actions_container->toolbar_actions_bar(); | 290 browser_actions_container->toolbar_actions_bar(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 // the message loop. Wait for this all to complete. | 379 // the message loop. Wait for this all to complete. |
373 EXPECT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 380 EXPECT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
374 native_window, ui::VKEY_RETURN, false, false, false, false)); | 381 native_window, ui::VKEY_RETURN, false, false, false, false)); |
375 base::RunLoop().RunUntilIdle(); | 382 base::RunLoop().RunUntilIdle(); |
376 | 383 |
377 // The menu should be closed. | 384 // The menu should be closed. |
378 EXPECT_FALSE(app_menu_button->IsMenuShowing()); | 385 EXPECT_FALSE(app_menu_button->IsMenuShowing()); |
379 // And the extension should have been activated. | 386 // And the extension should have been activated. |
380 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 387 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
381 } | 388 } |
OLD | NEW |