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

Side by Side Diff: components/keyed_service/content/browser_context_dependency_manager_unittest.cc

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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 "components/keyed_service/content/browser_context_dependency_manager.h" 5 #include "components/keyed_service/content/browser_context_dependency_manager.h"
6 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 6 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 class BrowserContextDependencyManagerUnittests : public ::testing::Test { 9 class BrowserContextDependencyManagerUnittests : public ::testing::Test {
10 protected: 10 protected:
(...skipping 15 matching lines...) Expand all
26 26
27 class TestService : public BrowserContextKeyedServiceFactory { 27 class TestService : public BrowserContextKeyedServiceFactory {
28 public: 28 public:
29 TestService(const std::string& name, 29 TestService(const std::string& name,
30 std::vector<std::string>* fill_on_shutdown, 30 std::vector<std::string>* fill_on_shutdown,
31 BrowserContextDependencyManager* manager) 31 BrowserContextDependencyManager* manager)
32 : BrowserContextKeyedServiceFactory("TestService", manager), 32 : BrowserContextKeyedServiceFactory("TestService", manager),
33 name_(name), 33 name_(name),
34 fill_on_shutdown_(fill_on_shutdown) {} 34 fill_on_shutdown_(fill_on_shutdown) {}
35 35
36 virtual KeyedService* BuildServiceInstanceFor( 36 KeyedService* BuildServiceInstanceFor(
37 content::BrowserContext* context) const override { 37 content::BrowserContext* context) const override {
38 ADD_FAILURE() << "This isn't part of the tests!"; 38 ADD_FAILURE() << "This isn't part of the tests!";
39 return NULL; 39 return NULL;
40 } 40 }
41 41
42 virtual void BrowserContextShutdown(content::BrowserContext* context) 42 void BrowserContextShutdown(content::BrowserContext* context) override {
43 override {
44 fill_on_shutdown_->push_back(name_); 43 fill_on_shutdown_->push_back(name_);
45 } 44 }
46 45
47 private: 46 private:
48 const std::string name_; 47 const std::string name_;
49 std::vector<std::string>* fill_on_shutdown_; 48 std::vector<std::string>* fill_on_shutdown_;
50 }; 49 };
51 50
52 // Tests that we can deal with a single component. 51 // Tests that we can deal with a single component.
53 TEST_F(BrowserContextDependencyManagerUnittests, SingleCase) { 52 TEST_F(BrowserContextDependencyManagerUnittests, SingleCase) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 manager()->DestroyBrowserContextServices(NULL); 162 manager()->DestroyBrowserContextServices(NULL);
164 163
165 ASSERT_EQ(6U, shutdown_order()->size()); 164 ASSERT_EQ(6U, shutdown_order()->size());
166 EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str()); 165 EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str());
167 EXPECT_STREQ("specialized_service", (*shutdown_order())[1].c_str()); 166 EXPECT_STREQ("specialized_service", (*shutdown_order())[1].c_str());
168 EXPECT_STREQ("other_intermediary", (*shutdown_order())[2].c_str()); 167 EXPECT_STREQ("other_intermediary", (*shutdown_order())[2].c_str());
169 EXPECT_STREQ("intermediary_service", (*shutdown_order())[3].c_str()); 168 EXPECT_STREQ("intermediary_service", (*shutdown_order())[3].c_str());
170 EXPECT_STREQ("other_root", (*shutdown_order())[4].c_str()); 169 EXPECT_STREQ("other_root", (*shutdown_order())[4].c_str());
171 EXPECT_STREQ("everything_depends_on_me", (*shutdown_order())[5].c_str()); 170 EXPECT_STREQ("everything_depends_on_me", (*shutdown_order())[5].c_str());
172 } 171 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698