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

Side by Side Diff: chrome/browser/local_discovery/privet_url_fetcher_unittest.cc

Issue 1100223002: Update {virtual,override} to follow C++11 style in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/local_discovery/privet_url_fetcher.h" 5 #include "chrome/browser/local_discovery/privet_url_fetcher.h"
6 #include "net/url_request/test_url_fetcher_factory.h" 6 #include "net/url_request/test_url_fetcher_factory.h"
7 #include "net/url_request/url_request_test_util.h" 7 #include "net/url_request/url_request_test_util.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 10 matching lines...) Expand all
21 21
22 const char kSampleParsableJSON[] = "{ \"hello\" : 2 }"; 22 const char kSampleParsableJSON[] = "{ \"hello\" : 2 }";
23 const char kSampleUnparsableJSON[] = "{ \"hello\" : }"; 23 const char kSampleUnparsableJSON[] = "{ \"hello\" : }";
24 const char kSampleJSONWithError[] = "{ \"error\" : \"unittest_example\" }"; 24 const char kSampleJSONWithError[] = "{ \"error\" : \"unittest_example\" }";
25 25
26 class MockPrivetURLFetcherDelegate : public PrivetURLFetcher::Delegate { 26 class MockPrivetURLFetcherDelegate : public PrivetURLFetcher::Delegate {
27 public: 27 public:
28 MockPrivetURLFetcherDelegate() : raw_mode_(false) { 28 MockPrivetURLFetcherDelegate() : raw_mode_(false) {
29 } 29 }
30 30
31 virtual ~MockPrivetURLFetcherDelegate() { 31 ~MockPrivetURLFetcherDelegate() override {
32 } 32 }
33 33
34 virtual void OnError(PrivetURLFetcher* fetcher, 34 void OnError(PrivetURLFetcher* fetcher,
35 PrivetURLFetcher::ErrorType error) override { 35 PrivetURLFetcher::ErrorType error) override {
36 OnErrorInternal(error); 36 OnErrorInternal(error);
37 } 37 }
38 38
39 MOCK_METHOD1(OnErrorInternal, void(PrivetURLFetcher::ErrorType error)); 39 MOCK_METHOD1(OnErrorInternal, void(PrivetURLFetcher::ErrorType error));
40 40
41 virtual void OnParsedJson(PrivetURLFetcher* fetcher, 41 void OnParsedJson(PrivetURLFetcher* fetcher,
42 const base::DictionaryValue& value, 42 const base::DictionaryValue& value,
43 bool has_error) override { 43 bool has_error) override {
44 saved_value_.reset(value.DeepCopy()); 44 saved_value_.reset(value.DeepCopy());
45 OnParsedJsonInternal(has_error); 45 OnParsedJsonInternal(has_error);
46 } 46 }
47 47
48 MOCK_METHOD1(OnParsedJsonInternal, void(bool has_error)); 48 MOCK_METHOD1(OnParsedJsonInternal, void(bool has_error));
49 49
50 virtual void OnNeedPrivetToken( 50 virtual void OnNeedPrivetToken(
51 PrivetURLFetcher* fetcher, 51 PrivetURLFetcher* fetcher,
52 const PrivetURLFetcher::TokenCallback& callback) { 52 const PrivetURLFetcher::TokenCallback& callback) {
53 } 53 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 std::string header_token; 312 std::string header_token;
313 ASSERT_FALSE(headers.GetHeader("X-Privet-Token", &header_token)); 313 ASSERT_FALSE(headers.GetHeader("X-Privet-Token", &header_token));
314 ASSERT_FALSE(headers.GetHeader("X-Privet-Auth", &header_token)); 314 ASSERT_FALSE(headers.GetHeader("X-Privet-Auth", &header_token));
315 ASSERT_TRUE(headers.GetHeader("Authorization", &header_token)); 315 ASSERT_TRUE(headers.GetHeader("Authorization", &header_token));
316 ASSERT_EQ("MyAuthToken", header_token); 316 ASSERT_EQ("MyAuthToken", header_token);
317 } 317 }
318 318
319 } // namespace 319 } // namespace
320 320
321 } // namespace local_discovery 321 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/privet_http_unittest.cc ('k') | chrome/browser/local_discovery/privetv3_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698