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

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

Issue 12494028: Move Requirements out of Extension Class (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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
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 "chrome/browser/extensions/extension_browsertest.h" 5 #include "chrome/browser/extensions/extension_browsertest.h"
6 #include "chrome/browser/extensions/extension_service.h" 6 #include "chrome/browser/extensions/extension_service.h"
7 #include "chrome/browser/extensions/extension_system.h" 7 #include "chrome/browser/extensions/extension_system.h"
8 #include "chrome/browser/extensions/extension_toolbar_model.h" 8 #include "chrome/browser/extensions/extension_toolbar_model.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 11 matching lines...) Expand all
22 public: 22 public:
23 virtual void SetUp() { 23 virtual void SetUp() {
24 inserted_count_ = 0; 24 inserted_count_ = 0;
25 removed_count_ = 0; 25 removed_count_ = 0;
26 moved_count_ = 0; 26 moved_count_ = 0;
27 27
28 ExtensionBrowserTest::SetUp(); 28 ExtensionBrowserTest::SetUp();
29 } 29 }
30 30
31 virtual void SetUpOnMainThread() OVERRIDE { 31 virtual void SetUpOnMainThread() OVERRIDE {
32 ExtensionBrowserTest::SetUpOnMainThread();
32 ExtensionService* service = extensions::ExtensionSystem::Get( 33 ExtensionService* service = extensions::ExtensionSystem::Get(
33 browser()->profile())->extension_service(); 34 browser()->profile())->extension_service();
34 model_ = service->toolbar_model(); 35 model_ = service->toolbar_model();
35 model_->AddObserver(this); 36 model_->AddObserver(this);
36 } 37 }
37 38
38 virtual void CleanUpOnMainThread() OVERRIDE { 39 virtual void CleanUpOnMainThread() OVERRIDE {
39 model_->RemoveObserver(this); 40 model_->RemoveObserver(this);
41 ExtensionBrowserTest::CleanUpOnMainThread();
40 } 42 }
41 43
42 virtual void BrowserActionAdded(const Extension* extension, 44 virtual void BrowserActionAdded(const Extension* extension,
43 int index) OVERRIDE { 45 int index) OVERRIDE {
44 inserted_count_++; 46 inserted_count_++;
45 } 47 }
46 48
47 virtual void BrowserActionRemoved(const Extension* extension) OVERRIDE { 49 virtual void BrowserActionRemoved(const Extension* extension) OVERRIDE {
48 removed_count_++; 50 removed_count_++;
49 } 51 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 229
228 // Load extension C again. 230 // Load extension C again.
229 ASSERT_TRUE(LoadExtension(extension_c_path)); 231 ASSERT_TRUE(LoadExtension(extension_c_path));
230 232
231 // Extension C loaded again. 233 // Extension C loaded again.
232 EXPECT_EQ(5, inserted_count_); 234 EXPECT_EQ(5, inserted_count_);
233 EXPECT_EQ(2u, model_->toolbar_items().size()); 235 EXPECT_EQ(2u, model_->toolbar_items().size());
234 // Make sure it gets its old spot in the list (at the very end). 236 // Make sure it gets its old spot in the list (at the very end).
235 ASSERT_STREQ(idC.c_str(), ExtensionAt(1)->id().c_str()); 237 ASSERT_STREQ(idC.c_str(), ExtensionAt(1)->id().c_str());
236 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698