| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_browsertest.h" | 6 #include "chrome/browser/extensions/extension_browsertest.h" |
| 7 #include "chrome/browser/extensions/extension_toolbar_model.h" | 7 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 577 |
| 578 // When we stop highlighting, we should see the new extension show up. | 578 // When we stop highlighting, we should see the new extension show up. |
| 579 model_->StopHighlighting(); | 579 model_->StopHighlighting(); |
| 580 EXPECT_FALSE(model_->is_highlighting()); | 580 EXPECT_FALSE(model_->is_highlighting()); |
| 581 EXPECT_EQ(3u, model_->toolbar_items().size()); | 581 EXPECT_EQ(3u, model_->toolbar_items().size()); |
| 582 EXPECT_EQ(id_a, ExtensionAt(0)->id()); | 582 EXPECT_EQ(id_a, ExtensionAt(0)->id()); |
| 583 EXPECT_EQ(id_b, ExtensionAt(1)->id()); | 583 EXPECT_EQ(id_b, ExtensionAt(1)->id()); |
| 584 EXPECT_EQ(id_c, ExtensionAt(2)->id()); | 584 EXPECT_EQ(id_c, ExtensionAt(2)->id()); |
| 585 } | 585 } |
| 586 | 586 |
| 587 IN_PROC_BROWSER_TEST_F(ExtensionToolbarModelTest, SizeAfterPrefChange) { | 587 // Test is flaky on Linus and ChromeOS, see crbug.com/379170. |
| 588 #if defined(OS_LINUX) || defined(OS_CHROMEOS) |
| 589 #define MAYBE_SizeAfterPrefChange DISABLED_SizeAfterPrefChange |
| 590 #else |
| 591 #define MAYBE_SizeAfterPrefChange SizeAfterPrefChange |
| 592 #endif |
| 593 IN_PROC_BROWSER_TEST_F(ExtensionToolbarModelTest, MAYBE_SizeAfterPrefChange) { |
| 588 // Load two extensions with browser action. | 594 // Load two extensions with browser action. |
| 589 base::FilePath extension_a_path(test_data_dir_.AppendASCII("api_test") | 595 base::FilePath extension_a_path(test_data_dir_.AppendASCII("api_test") |
| 590 .AppendASCII("browser_action") | 596 .AppendASCII("browser_action") |
| 591 .AppendASCII("basics")); | 597 .AppendASCII("basics")); |
| 592 ASSERT_TRUE(LoadExtension(extension_a_path)); | 598 ASSERT_TRUE(LoadExtension(extension_a_path)); |
| 593 base::FilePath extension_b_path(test_data_dir_.AppendASCII("api_test") | 599 base::FilePath extension_b_path(test_data_dir_.AppendASCII("api_test") |
| 594 .AppendASCII("browser_action") | 600 .AppendASCII("browser_action") |
| 595 .AppendASCII("popup")); | 601 .AppendASCII("popup")); |
| 596 ASSERT_TRUE(LoadExtension(extension_b_path)); | 602 ASSERT_TRUE(LoadExtension(extension_b_path)); |
| 597 std::string id_a = ExtensionAt(0)->id(); | 603 std::string id_a = ExtensionAt(0)->id(); |
| 598 std::string id_b = ExtensionAt(1)->id(); | 604 std::string id_b = ExtensionAt(1)->id(); |
| 599 | 605 |
| 600 // Should be at max size (-1). | 606 // Should be at max size (-1). |
| 601 EXPECT_EQ(-1, model_->GetVisibleIconCount()); | 607 EXPECT_EQ(-1, model_->GetVisibleIconCount()); |
| 602 | 608 |
| 603 model_->OnExtensionToolbarPrefChange(); | 609 model_->OnExtensionToolbarPrefChange(); |
| 604 | 610 |
| 605 // Should still be at max size. | 611 // Should still be at max size. |
| 606 EXPECT_EQ(-1, model_->GetVisibleIconCount()); | 612 EXPECT_EQ(-1, model_->GetVisibleIconCount()); |
| 607 } | 613 } |
| 608 | 614 |
| 609 } // namespace extensions | 615 } // namespace extensions |
| OLD | NEW |