diff options
author | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 18:28:17 +0000 |
---|---|---|
committer | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 18:28:17 +0000 |
commit | 5d44d1575ddf91ceef2958adc4d90989a34a470b (patch) | |
tree | ffbc54a561c47809fdecc13eb15dffda2aef388c /chrome/browser/extensions/extension_toolbar_model_browsertest.cc | |
parent | 23ffdefe3f1578c742faf9c99e4deeb88fd641bf (diff) | |
download | chromium_src-5d44d1575ddf91ceef2958adc4d90989a34a470b.zip chromium_src-5d44d1575ddf91ceef2958adc4d90989a34a470b.tar.gz chromium_src-5d44d1575ddf91ceef2958adc4d90989a34a470b.tar.bz2 |
Sync extension icon order on toolbar.
BUG=53999
Review URL: https://chromiumcodereview.appspot.com/14031023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197666 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_toolbar_model_browsertest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_toolbar_model_browsertest.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_toolbar_model_browsertest.cc b/chrome/browser/extensions/extension_toolbar_model_browsertest.cc index 1833fab..9a46a8b 100644 --- a/chrome/browser/extensions/extension_toolbar_model_browsertest.cc +++ b/chrome/browser/extensions/extension_toolbar_model_browsertest.cc @@ -347,3 +347,34 @@ IN_PROC_BROWSER_TEST_F(ExtensionToolbarModelTest, Uninstall) { EXPECT_STREQ(idA.c_str(), ExtensionAt(0)->id().c_str()); EXPECT_STREQ(idB.c_str(), ExtensionAt(1)->id().c_str()); } + +IN_PROC_BROWSER_TEST_F(ExtensionToolbarModelTest, ReorderOnPrefChange) { + // Load three extensions with browser action. + base::FilePath extension_a_path(test_data_dir_.AppendASCII("api_test") + .AppendASCII("browser_action") + .AppendASCII("basics")); + ASSERT_TRUE(LoadExtension(extension_a_path)); + base::FilePath extension_b_path(test_data_dir_.AppendASCII("api_test") + .AppendASCII("browser_action") + .AppendASCII("popup")); + ASSERT_TRUE(LoadExtension(extension_b_path)); + base::FilePath extension_c_path(test_data_dir_.AppendASCII("api_test") + .AppendASCII("browser_action") + .AppendASCII("remove_popup")); + ASSERT_TRUE(LoadExtension(extension_c_path)); + std::string id_a = ExtensionAt(0)->id(); + std::string id_b = ExtensionAt(1)->id(); + std::string id_c = ExtensionAt(2)->id(); + + // Change value of toolbar preference. + extensions::ExtensionIdList new_order; + new_order.push_back(id_c); + new_order.push_back(id_b); + extensions::ExtensionSystem::Get(browser()->profile()) + ->extension_prefs()->SetToolbarOrder(new_order); + + // Verify order is changed. + EXPECT_EQ(id_c, ExtensionAt(0)->id()); + EXPECT_EQ(id_b, ExtensionAt(1)->id()); + EXPECT_EQ(id_a, ExtensionAt(2)->id()); +} |