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

Side by Side Diff: chrome/test/chromedriver/command_listener_proxy_unittest.cc

Issue 637933002: Replace FINAL and OVERRIDE with their C++11 counterparts in chrome/test (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 <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/test/chromedriver/chrome/status.h" 9 #include "chrome/test/chromedriver/chrome/status.h"
10 #include "chrome/test/chromedriver/command_listener_proxy.h" 10 #include "chrome/test/chromedriver/command_listener_proxy.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace { 13 namespace {
14 14
15 class MockCommandListener : public CommandListener { 15 class MockCommandListener : public CommandListener {
16 public: 16 public:
17 MockCommandListener() : called_(false) {} 17 MockCommandListener() : called_(false) {}
18 virtual ~MockCommandListener() {} 18 virtual ~MockCommandListener() {}
19 19
20 virtual Status BeforeCommand(const std::string& command_name) OVERRIDE { 20 virtual Status BeforeCommand(const std::string& command_name) override {
21 called_ = true; 21 called_ = true;
22 EXPECT_STREQ("cmd", command_name.c_str()); 22 EXPECT_STREQ("cmd", command_name.c_str());
23 return Status(kOk); 23 return Status(kOk);
24 } 24 }
25 25
26 void VerifyCalled() { 26 void VerifyCalled() {
27 EXPECT_TRUE(called_); 27 EXPECT_TRUE(called_);
28 } 28 }
29 29
30 void VerifyNotCalled() { 30 void VerifyNotCalled() {
31 EXPECT_FALSE(called_); 31 EXPECT_FALSE(called_);
32 } 32 }
33 33
34 private: 34 private:
35 bool called_; 35 bool called_;
36 }; 36 };
37 37
38 } // namespace 38 } // namespace
39 39
40 TEST(CommandListenerProxy, ForwardsCommands) { 40 TEST(CommandListenerProxy, ForwardsCommands) {
41 MockCommandListener listener; 41 MockCommandListener listener;
42 listener.VerifyNotCalled(); 42 listener.VerifyNotCalled();
43 CommandListenerProxy proxy(&listener); 43 CommandListenerProxy proxy(&listener);
44 listener.VerifyNotCalled(); 44 listener.VerifyNotCalled();
45 ASSERT_EQ(kOk, proxy.BeforeCommand("cmd").code()); 45 ASSERT_EQ(kOk, proxy.BeforeCommand("cmd").code());
46 listener.VerifyCalled(); 46 listener.VerifyCalled();
47 } 47 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/command_listener_proxy.h ('k') | chrome/test/chromedriver/commands_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698