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

Side by Side Diff: chrome/browser/chromeos/login/auth/online_attempt_unittest.cc

Issue 856493004: Update {virtual,override,final} to follow C++11 style in chrome/browser/chromeos/login. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 19 matching lines...) Expand all
30 using ::testing::Return; 30 using ::testing::Return;
31 using ::testing::_; 31 using ::testing::_;
32 32
33 namespace { 33 namespace {
34 34
35 class TestContextURLRequestContextGetter : public net::URLRequestContextGetter { 35 class TestContextURLRequestContextGetter : public net::URLRequestContextGetter {
36 public: 36 public:
37 TestContextURLRequestContextGetter() 37 TestContextURLRequestContextGetter()
38 : null_task_runner_(new base::NullTaskRunner) {} 38 : null_task_runner_(new base::NullTaskRunner) {}
39 39
40 virtual net::URLRequestContext* GetURLRequestContext() override { 40 net::URLRequestContext* GetURLRequestContext() override { return &context_; }
41 return &context_;
42 }
43 41
44 virtual scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() 42 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
45 const override { 43 const override {
46 return null_task_runner_; 44 return null_task_runner_;
47 } 45 }
48 46
49 private: 47 private:
50 virtual ~TestContextURLRequestContextGetter() {} 48 ~TestContextURLRequestContextGetter() override {}
51 49
52 net::TestURLRequestContext context_; 50 net::TestURLRequestContext context_;
53 scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_; 51 scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_;
54 }; 52 };
55 53
56 } // namespace 54 } // namespace
57 55
58 namespace chromeos { 56 namespace chromeos {
59 57
60 class OnlineAttemptTest : public testing::Test { 58 class OnlineAttemptTest : public testing::Test {
61 public: 59 public:
62 OnlineAttemptTest() 60 OnlineAttemptTest()
63 : state_(UserContext(), false), 61 : state_(UserContext(), false),
64 attempt_(new OnlineAttempt(&state_, &resolver_)) {} 62 attempt_(new OnlineAttempt(&state_, &resolver_)) {}
65 63
66 virtual void SetUp() override { 64 void SetUp() override {
67 message_loop_ = base::MessageLoopProxy::current(); 65 message_loop_ = base::MessageLoopProxy::current();
68 request_context_ = new TestContextURLRequestContextGetter(); 66 request_context_ = new TestContextURLRequestContextGetter();
69 } 67 }
70 68
71 void RunFailureTest(const GoogleServiceAuthError& error) { 69 void RunFailureTest(const GoogleServiceAuthError& error) {
72 EXPECT_CALL(resolver_, Resolve()).Times(1).RetiresOnSaturation(); 70 EXPECT_CALL(resolver_, Resolve()).Times(1).RetiresOnSaturation();
73 71
74 message_loop_->PostTask(FROM_HERE, 72 message_loop_->PostTask(FROM_HERE,
75 base::Bind(&OnlineAttempt::OnClientLoginFailure, 73 base::Bind(&OnlineAttempt::OnClientLoginFailure,
76 attempt_->weak_factory_.GetWeakPtr(), 74 attempt_->weak_factory_.GetWeakPtr(),
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 attempt_->weak_factory_.GetWeakPtr(), 235 attempt_->weak_factory_.GetWeakPtr(),
238 error)); 236 error));
239 237
240 // Force UI thread to finish tasks so I can verify |state_|. 238 // Force UI thread to finish tasks so I can verify |state_|.
241 base::RunLoop().RunUntilIdle(); 239 base::RunLoop().RunUntilIdle();
242 EXPECT_TRUE(GoogleServiceAuthError::AuthErrorNone() == 240 EXPECT_TRUE(GoogleServiceAuthError::AuthErrorNone() ==
243 state_.online_outcome().error()); 241 state_.online_outcome().error());
244 } 242 }
245 243
246 } // namespace chromeos 244 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698