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

Side by Side Diff: chrome/browser/extensions/api/push_messaging/obfuscated_gaia_id_fetcher_unittest.cc

Issue 624153002: replace OVERRIDE and FINAL with override and 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/browser/extensions/api/push_messaging/obfuscated_gaia_id_fetche r.h" 9 #include "chrome/browser/extensions/api/push_messaging/obfuscated_gaia_id_fetche r.h"
10 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api.h" 10 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api.h"
11 #include "net/url_request/test_url_fetcher_factory.h" 11 #include "net/url_request/test_url_fetcher_factory.h"
12 12
13 namespace { 13 namespace {
14 14
15 static const char kGoodData[] = "{ \"id\" : \"My-channel-id\" }"; 15 static const char kGoodData[] = "{ \"id\" : \"My-channel-id\" }";
16 static const char kBadJsonData[] = "I am not a JSON string"; 16 static const char kBadJsonData[] = "I am not a JSON string";
17 static const char kDictionaryMissingIdData[] = "{ \"foo\" : \"bar\" }"; 17 static const char kDictionaryMissingIdData[] = "{ \"foo\" : \"bar\" }";
18 static const char kNonDictionaryJsonData[] = "{ 0.5 }"; 18 static const char kNonDictionaryJsonData[] = "{ 0.5 }";
19 19
20 // Delegate class for catching notifications from the ObfuscatedGaiaIdFetcher. 20 // Delegate class for catching notifications from the ObfuscatedGaiaIdFetcher.
21 class TestDelegate : public extensions::ObfuscatedGaiaIdFetcher::Delegate { 21 class TestDelegate : public extensions::ObfuscatedGaiaIdFetcher::Delegate {
22 public: 22 public:
23 virtual void OnObfuscatedGaiaIdFetchSuccess( 23 virtual void OnObfuscatedGaiaIdFetchSuccess(
24 const std::string& obfuscated_id) OVERRIDE { 24 const std::string& obfuscated_id) override {
25 succeeded_ = true; 25 succeeded_ = true;
26 } 26 }
27 virtual void OnObfuscatedGaiaIdFetchFailure( 27 virtual void OnObfuscatedGaiaIdFetchFailure(
28 const GoogleServiceAuthError& error) OVERRIDE { 28 const GoogleServiceAuthError& error) override {
29 failed_ = true; 29 failed_ = true;
30 } 30 }
31 TestDelegate() : succeeded_(false), failed_(false) {} 31 TestDelegate() : succeeded_(false), failed_(false) {}
32 virtual ~TestDelegate() {} 32 virtual ~TestDelegate() {}
33 bool succeeded() const { return succeeded_; } 33 bool succeeded() const { return succeeded_; }
34 bool failed() const { return failed_; } 34 bool failed() const { return failed_; }
35 35
36 private: 36 private:
37 bool succeeded_; 37 bool succeeded_;
38 bool failed_; 38 bool failed_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 // Test with bad data, ensure it fails. 99 // Test with bad data, ensure it fails.
100 fetcher.ProcessApiCallSuccess(&url_fetcher); 100 fetcher.ProcessApiCallSuccess(&url_fetcher);
101 EXPECT_TRUE(delegate.failed()); 101 EXPECT_TRUE(delegate.failed());
102 102
103 // TODO(petewil): add case for when the base class fails and calls 103 // TODO(petewil): add case for when the base class fails and calls
104 // ProcessApiCallFailure 104 // ProcessApiCallFailure
105 } 105 }
106 106
107 } // namespace extensions 107 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698