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

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

Issue 666153002: Standardize usage of virtual/override/final in chrome/browser/extensions/ (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 "chrome/browser/extensions/extension_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 class FakeExtensionGCMAppHandler : public ExtensionGCMAppHandler { 134 class FakeExtensionGCMAppHandler : public ExtensionGCMAppHandler {
135 public: 135 public:
136 FakeExtensionGCMAppHandler(Profile* profile, Waiter* waiter) 136 FakeExtensionGCMAppHandler(Profile* profile, Waiter* waiter)
137 : ExtensionGCMAppHandler(profile), 137 : ExtensionGCMAppHandler(profile),
138 waiter_(waiter), 138 waiter_(waiter),
139 unregistration_result_(gcm::GCMClient::UNKNOWN_ERROR), 139 unregistration_result_(gcm::GCMClient::UNKNOWN_ERROR),
140 app_handler_count_drop_to_zero_(false) { 140 app_handler_count_drop_to_zero_(false) {
141 } 141 }
142 142
143 virtual ~FakeExtensionGCMAppHandler() { 143 ~FakeExtensionGCMAppHandler() override {}
144 }
145 144
146 virtual void OnMessage( 145 void OnMessage(const std::string& app_id,
146 const gcm::GCMClient::IncomingMessage& message) override {}
147
148 void OnMessagesDeleted(const std::string& app_id) override {}
149
150 void OnSendError(
147 const std::string& app_id, 151 const std::string& app_id,
148 const gcm::GCMClient::IncomingMessage& message) override { 152 const gcm::GCMClient::SendErrorDetails& send_error_details) override {}
149 }
150 153
151 virtual void OnMessagesDeleted(const std::string& app_id) override { 154 void OnUnregisterCompleted(const std::string& app_id,
152 } 155 gcm::GCMClient::Result result) override {
153
154 virtual void OnSendError(
155 const std::string& app_id,
156 const gcm::GCMClient::SendErrorDetails& send_error_details) override {
157 }
158
159 virtual void OnUnregisterCompleted(const std::string& app_id,
160 gcm::GCMClient::Result result) override {
161 unregistration_result_ = result; 156 unregistration_result_ = result;
162 waiter_->SignalCompleted(); 157 waiter_->SignalCompleted();
163 } 158 }
164 159
165 virtual void RemoveAppHandler(const std::string& app_id) override{ 160 void RemoveAppHandler(const std::string& app_id) override {
166 ExtensionGCMAppHandler::RemoveAppHandler(app_id); 161 ExtensionGCMAppHandler::RemoveAppHandler(app_id);
167 if (!GetGCMDriver()->app_handlers().size()) 162 if (!GetGCMDriver()->app_handlers().size())
168 app_handler_count_drop_to_zero_ = true; 163 app_handler_count_drop_to_zero_ = true;
169 } 164 }
170 165
171 gcm::GCMClient::Result unregistration_result() const { 166 gcm::GCMClient::Result unregistration_result() const {
172 return unregistration_result_; 167 return unregistration_result_;
173 } 168 }
174 bool app_handler_count_drop_to_zero() const { 169 bool app_handler_count_drop_to_zero() const {
175 return app_handler_count_drop_to_zero_; 170 return app_handler_count_drop_to_zero_;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 485
491 // App handler is removed when the extension is updated to the version that 486 // App handler is removed when the extension is updated to the version that
492 // has GCM permission removed. 487 // has GCM permission removed.
493 UpdateExtension(extension.get(), "good2.crx"); 488 UpdateExtension(extension.get(), "good2.crx");
494 waiter()->PumpUILoop(); 489 waiter()->PumpUILoop();
495 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); 490 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero());
496 EXPECT_FALSE(HasAppHandlers(extension->id())); 491 EXPECT_FALSE(HasAppHandlers(extension->id()));
497 } 492 }
498 493
499 } // namespace extensions 494 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler.h ('k') | chrome/browser/extensions/extension_geolocation_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698