| 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_action_test_util.h" | 8 #include "chrome/browser/extensions/extension_action_test_util.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 // Make sure we did all the expected tests. | 290 // Make sure we did all the expected tests. |
| 291 EXPECT_TRUE(did_test_while_menu_open); | 291 EXPECT_TRUE(did_test_while_menu_open); |
| 292 | 292 |
| 293 // We should have navigated to the extension's home page, which is google.com. | 293 // We should have navigated to the extension's home page, which is google.com. |
| 294 EXPECT_EQ( | 294 EXPECT_EQ( |
| 295 GURL("https://www.google.com/"), | 295 GURL("https://www.google.com/"), |
| 296 browser()->tab_strip_model()->GetActiveWebContents()->GetVisibleURL()); | 296 browser()->tab_strip_model()->GetActiveWebContents()->GetVisibleURL()); |
| 297 } | 297 } |
| 298 | 298 |
| 299 // TODO(crbug.com/617056) Flaky on Win 7. |
| 300 #if defined(OS_WIN) |
| 301 #define MAYBE_DoubleClickToolbarActionToClose \ |
| 302 DISABLED_DoubleClickToolbarActionToClose |
| 303 #else |
| 304 #define MAYBE_DoubleClickToolbarActionToClose DoubleClickToolbarActionToClose |
| 305 #endif |
| 299 // Tests that clicking on the toolbar action a second time when the action is | 306 // Tests that clicking on the toolbar action a second time when the action is |
| 300 // already open results in closing the popup, and doesn't re-open it. | 307 // already open results in closing the popup, and doesn't re-open it. |
| 301 IN_PROC_BROWSER_TEST_F(ToolbarActionViewInteractiveUITest, | 308 IN_PROC_BROWSER_TEST_F(ToolbarActionViewInteractiveUITest, |
| 302 DoubleClickToolbarActionToClose) { | 309 MAYBE_DoubleClickToolbarActionToClose) { |
| 303 ASSERT_TRUE(LoadExtension( | 310 ASSERT_TRUE(LoadExtension( |
| 304 test_data_dir_.AppendASCII("ui").AppendASCII("browser_action_popup"))); | 311 test_data_dir_.AppendASCII("ui").AppendASCII("browser_action_popup"))); |
| 305 base::RunLoop().RunUntilIdle(); // Ensure the extension is fully loaded. | 312 base::RunLoop().RunUntilIdle(); // Ensure the extension is fully loaded. |
| 306 | 313 |
| 307 BrowserActionsContainer* browser_actions_container = | 314 BrowserActionsContainer* browser_actions_container = |
| 308 BrowserView::GetBrowserViewForBrowser(browser()) | 315 BrowserView::GetBrowserViewForBrowser(browser()) |
| 309 ->toolbar() | 316 ->toolbar() |
| 310 ->browser_actions(); | 317 ->browser_actions(); |
| 311 ToolbarActionsBar* toolbar_actions_bar = | 318 ToolbarActionsBar* toolbar_actions_bar = |
| 312 browser_actions_container->toolbar_actions_bar(); | 319 browser_actions_container->toolbar_actions_bar(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, | 397 ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, |
| 391 base::Bind(&ActivateOverflowedActionWithKeyboard, | 398 base::Bind(&ActivateOverflowedActionWithKeyboard, |
| 392 browser(), loop.QuitClosure())); | 399 browser(), loop.QuitClosure())); |
| 393 loop.Run(); | 400 loop.Run(); |
| 394 | 401 |
| 395 // The app menu should no longer be showing. | 402 // The app menu should no longer be showing. |
| 396 EXPECT_FALSE(app_menu_button->IsMenuShowing()); | 403 EXPECT_FALSE(app_menu_button->IsMenuShowing()); |
| 397 // And the extension should have been activated. | 404 // And the extension should have been activated. |
| 398 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 405 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 399 } | 406 } |
| OLD | NEW |