OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/toolbar/browser_actions_bar_browsertest.h" | 5 #include "chrome/browser/ui/toolbar/browser_actions_bar_browsertest.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
9 #include "chrome/browser/extensions/browser_action_test_util.h" | 9 #include "chrome/browser/extensions/browser_action_test_util.h" |
10 #include "chrome/browser/extensions/extension_action.h" | 10 #include "chrome/browser/extensions/extension_action.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 // Make the extension want to run again, and then move it out of the overflow | 329 // Make the extension want to run again, and then move it out of the overflow |
330 // menu. This should stop the wrench menu from having the special UI. | 330 // menu. This should stop the wrench menu from having the special UI. |
331 action->SetIsVisible(tab_id, true); | 331 action->SetIsVisible(tab_id, true); |
332 extension_action_api->NotifyChange(action, web_contents, profile()); | 332 extension_action_api->NotifyChange(action, web_contents, profile()); |
333 EXPECT_TRUE(browser_actions_bar()->OverflowedActionButtonWantsToRun()); | 333 EXPECT_TRUE(browser_actions_bar()->OverflowedActionButtonWantsToRun()); |
334 toolbar_model()->SetVisibleIconCount(4); | 334 toolbar_model()->SetVisibleIconCount(4); |
335 EXPECT_FALSE(browser_actions_bar()->OverflowedActionButtonWantsToRun()); | 335 EXPECT_FALSE(browser_actions_bar()->OverflowedActionButtonWantsToRun()); |
336 } | 336 } |
337 | 337 |
338 IN_PROC_BROWSER_TEST_F(BrowserActionsBarBrowserTest, BrowserActionPopupTest) { | 338 // Flaky on Mac ASan 64 bot. See http://crbug.com/498665. |
| 339 #if defined(OS_MACOSX) && defined(ADDRESS_SANITIZER) |
| 340 #define MAYBE_BrowserActionPopupTest DISABLED_BrowserActionPopupTest |
| 341 #else |
| 342 #define MAYBE_BrowserActionPopupTest BrowserActionPopupTest |
| 343 #endif |
| 344 IN_PROC_BROWSER_TEST_F(BrowserActionsBarBrowserTest, |
| 345 MAYBE_BrowserActionPopupTest) { |
339 // Load up two extensions that have browser action popups. | 346 // Load up two extensions that have browser action popups. |
340 base::FilePath data_dir = | 347 base::FilePath data_dir = |
341 test_data_dir_.AppendASCII("api_test").AppendASCII("browser_action"); | 348 test_data_dir_.AppendASCII("api_test").AppendASCII("browser_action"); |
342 const extensions::Extension* first_extension = | 349 const extensions::Extension* first_extension = |
343 LoadExtension(data_dir.AppendASCII("open_popup")); | 350 LoadExtension(data_dir.AppendASCII("open_popup")); |
344 ASSERT_TRUE(first_extension); | 351 ASSERT_TRUE(first_extension); |
345 const extensions::Extension* second_extension = | 352 const extensions::Extension* second_extension = |
346 LoadExtension(data_dir.AppendASCII("remove_popup")); | 353 LoadExtension(data_dir.AppendASCII("remove_popup")); |
347 ASSERT_TRUE(second_extension); | 354 ASSERT_TRUE(second_extension); |
348 | 355 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 EXPECT_EQ(page_action_extension->id(), | 516 EXPECT_EQ(page_action_extension->id(), |
510 browser_actions_bar()->GetExtensionId(0)); | 517 browser_actions_bar()->GetExtensionId(0)); |
511 browser_actions_bar()->Press(0); | 518 browser_actions_bar()->Press(0); |
512 base::RunLoop().RunUntilIdle(); | 519 base::RunLoop().RunUntilIdle(); |
513 EXPECT_TRUE(browser_actions_bar()->HasPopup()); | 520 EXPECT_TRUE(browser_actions_bar()->HasPopup()); |
514 // Cleanup the popup (to avoid having windows open at tear down). | 521 // Cleanup the popup (to avoid having windows open at tear down). |
515 browser_actions_bar()->HidePopup(); | 522 browser_actions_bar()->HidePopup(); |
516 content::RunAllBlockingPoolTasksUntilIdle(); | 523 content::RunAllBlockingPoolTasksUntilIdle(); |
517 EXPECT_FALSE(browser_actions_bar()->HasPopup()); | 524 EXPECT_FALSE(browser_actions_bar()->HasPopup()); |
518 } | 525 } |
OLD | NEW |