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

Side by Side Diff: chrome/browser/invalidation/gcm_invalidation_bridge_unittest.cc

Issue 625113002: replace OVERRIDE and FINAL with override and final in chrome/browser/[a-i]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix newly added OVERRIDEs 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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 6 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
7 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" 7 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h"
8 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 8 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
9 #include "chrome/test/base/testing_profile.h" 9 #include "chrome/test/base/testing_profile.h"
10 #include "components/gcm_driver/fake_gcm_driver.h" 10 #include "components/gcm_driver/fake_gcm_driver.h"
(...skipping 12 matching lines...) Expand all
23 // registrationId. 23 // registrationId.
24 class CustomFakeGCMDriver : public gcm::FakeGCMDriver { 24 class CustomFakeGCMDriver : public gcm::FakeGCMDriver {
25 public: 25 public:
26 CustomFakeGCMDriver() {} 26 CustomFakeGCMDriver() {}
27 virtual ~CustomFakeGCMDriver() {} 27 virtual ~CustomFakeGCMDriver() {}
28 28
29 protected: 29 protected:
30 // FakeGCMDriver override: 30 // FakeGCMDriver override:
31 virtual void RegisterImpl( 31 virtual void RegisterImpl(
32 const std::string& app_id, 32 const std::string& app_id,
33 const std::vector<std::string>& sender_ids) OVERRIDE { 33 const std::vector<std::string>& sender_ids) override {
34 base::MessageLoop::current()->PostTask( 34 base::MessageLoop::current()->PostTask(
35 FROM_HERE, 35 FROM_HERE,
36 base::Bind(&CustomFakeGCMDriver::RegisterFinished, 36 base::Bind(&CustomFakeGCMDriver::RegisterFinished,
37 base::Unretained(this), 37 base::Unretained(this),
38 app_id, 38 app_id,
39 std::string("registration.id"), 39 std::string("registration.id"),
40 gcm::GCMClient::SUCCESS)); 40 gcm::GCMClient::SUCCESS));
41 } 41 }
42 42
43 private: 43 private:
44 DISALLOW_COPY_AND_ASSIGN(CustomFakeGCMDriver); 44 DISALLOW_COPY_AND_ASSIGN(CustomFakeGCMDriver);
45 }; 45 };
46 46
47 class GCMInvalidationBridgeTest : public ::testing::Test { 47 class GCMInvalidationBridgeTest : public ::testing::Test {
48 protected: 48 protected:
49 GCMInvalidationBridgeTest() 49 GCMInvalidationBridgeTest()
50 : connection_online_(false) {} 50 : connection_online_(false) {}
51 51
52 virtual ~GCMInvalidationBridgeTest() {} 52 virtual ~GCMInvalidationBridgeTest() {}
53 53
54 virtual void SetUp() OVERRIDE { 54 virtual void SetUp() override {
55 TestingProfile::Builder builder; 55 TestingProfile::Builder builder;
56 builder.AddTestingFactory(ProfileOAuth2TokenServiceFactory::GetInstance(), 56 builder.AddTestingFactory(ProfileOAuth2TokenServiceFactory::GetInstance(),
57 &BuildAutoIssuingFakeProfileOAuth2TokenService); 57 &BuildAutoIssuingFakeProfileOAuth2TokenService);
58 profile_ = builder.Build(); 58 profile_ = builder.Build();
59 59
60 FakeProfileOAuth2TokenService* token_service = 60 FakeProfileOAuth2TokenService* token_service =
61 (FakeProfileOAuth2TokenService*) 61 (FakeProfileOAuth2TokenService*)
62 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get()); 62 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get());
63 token_service->IssueRefreshTokenForUser("", "fake_refresh_token"); 63 token_service->IssueRefreshTokenForUser("", "fake_refresh_token");
64 gcm_driver_.reset(new CustomFakeGCMDriver()); 64 gcm_driver_.reset(new CustomFakeGCMDriver());
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 bridge_->OnConnected(net::IPEndPoint()); 156 bridge_->OnConnected(net::IPEndPoint());
157 RunLoop(); 157 RunLoop();
158 EXPECT_TRUE(connection_online_); 158 EXPECT_TRUE(connection_online_);
159 bridge_->OnDisconnected(); 159 bridge_->OnDisconnected();
160 RunLoop(); 160 RunLoop();
161 EXPECT_FALSE(connection_online_); 161 EXPECT_FALSE(connection_online_);
162 } 162 }
163 163
164 } // namespace 164 } // namespace
165 } // namespace invalidation 165 } // namespace invalidation
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698