Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/browser/extensions/extension_toolbar_model_browsertest.cc

Issue 296983014: Fix issue with browser action toolbar putting all extension icons in overflow once sync happens. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Polish Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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) {
588 // Load two extensions with browser action.
589 base::FilePath extension_a_path(test_data_dir_.AppendASCII("api_test")
590 .AppendASCII("browser_action")
591 .AppendASCII("basics"));
592 ASSERT_TRUE(LoadExtension(extension_a_path));
593 base::FilePath extension_b_path(test_data_dir_.AppendASCII("api_test")
594 .AppendASCII("browser_action")
595 .AppendASCII("popup"));
596 ASSERT_TRUE(LoadExtension(extension_b_path));
597 std::string id_a = ExtensionAt(0)->id();
598 std::string id_b = ExtensionAt(1)->id();
599
600 // Should be at max size (-1).
601 EXPECT_EQ(-1, model_->GetVisibleIconCount());
602
603 model_->OnExtensionToolbarPrefChange();
604
605 // Should still be at max size.
606 EXPECT_EQ(-1, model_->GetVisibleIconCount());
607 }
608
587 } // namespace extensions 609 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698