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

Side by Side Diff: base/test/test_support_android.cc

Issue 611153004: replace OVERRIDE and FINAL with override and final in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CC_ -> BASE_ 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
« no previous file with comments | « base/test/test_suite.cc ('k') | base/threading/non_thread_safe_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdarg.h> 5 #include <stdarg.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "base/android/path_utils.h" 8 #include "base/android/path_utils.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 base::WaitableEvent waitable_event_; 68 base::WaitableEvent waitable_event_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(Waitable); 70 DISALLOW_COPY_AND_ASSIGN(Waitable);
71 }; 71 };
72 72
73 // The MessagePumpForUI implementation for test purpose. 73 // The MessagePumpForUI implementation for test purpose.
74 class MessagePumpForUIStub : public base::MessagePumpForUI { 74 class MessagePumpForUIStub : public base::MessagePumpForUI {
75 virtual ~MessagePumpForUIStub() {} 75 virtual ~MessagePumpForUIStub() {}
76 76
77 virtual void Start(base::MessagePump::Delegate* delegate) OVERRIDE { 77 virtual void Start(base::MessagePump::Delegate* delegate) override {
78 NOTREACHED() << "The Start() method shouldn't be called in test, using" 78 NOTREACHED() << "The Start() method shouldn't be called in test, using"
79 " Run() method should be used."; 79 " Run() method should be used.";
80 } 80 }
81 81
82 virtual void Run(base::MessagePump::Delegate* delegate) OVERRIDE { 82 virtual void Run(base::MessagePump::Delegate* delegate) override {
83 // The following was based on message_pump_glib.cc, except we're using a 83 // The following was based on message_pump_glib.cc, except we're using a
84 // WaitableEvent since there are no native message loop to use. 84 // WaitableEvent since there are no native message loop to use.
85 RunState state(delegate, g_state ? g_state->run_depth + 1 : 1); 85 RunState state(delegate, g_state ? g_state->run_depth + 1 : 1);
86 86
87 RunState* previous_state = g_state; 87 RunState* previous_state = g_state;
88 g_state = &state; 88 g_state = &state;
89 89
90 bool more_work_is_plausible = true; 90 bool more_work_is_plausible = true;
91 91
92 for (;;) { 92 for (;;) {
(...skipping 19 matching lines...) Expand all
112 more_work_is_plausible = g_state->delegate->DoIdleWork(); 112 more_work_is_plausible = g_state->delegate->DoIdleWork();
113 if (g_state->should_quit) 113 if (g_state->should_quit)
114 break; 114 break;
115 115
116 more_work_is_plausible |= !delayed_work_time.is_null(); 116 more_work_is_plausible |= !delayed_work_time.is_null();
117 } 117 }
118 118
119 g_state = previous_state; 119 g_state = previous_state;
120 } 120 }
121 121
122 virtual void Quit() OVERRIDE { 122 virtual void Quit() override {
123 Waitable::GetInstance()->Quit(); 123 Waitable::GetInstance()->Quit();
124 } 124 }
125 125
126 virtual void ScheduleWork() OVERRIDE { 126 virtual void ScheduleWork() override {
127 Waitable::GetInstance()->Signal(); 127 Waitable::GetInstance()->Signal();
128 } 128 }
129 129
130 virtual void ScheduleDelayedWork( 130 virtual void ScheduleDelayedWork(
131 const base::TimeTicks& delayed_work_time) OVERRIDE { 131 const base::TimeTicks& delayed_work_time) override {
132 Waitable::GetInstance()->Signal(); 132 Waitable::GetInstance()->Signal();
133 } 133 }
134 }; 134 };
135 135
136 scoped_ptr<base::MessagePump> CreateMessagePumpForUIStub() { 136 scoped_ptr<base::MessagePump> CreateMessagePumpForUIStub() {
137 return scoped_ptr<base::MessagePump>(new MessagePumpForUIStub()); 137 return scoped_ptr<base::MessagePump>(new MessagePumpForUIStub());
138 }; 138 };
139 139
140 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA. 140 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA.
141 bool GetTestProviderPath(int key, base::FilePath* result) { 141 bool GetTestProviderPath(int key, base::FilePath* result) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) 180 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub))
181 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; 181 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override.";
182 } 182 }
183 183
184 void InitAndroidTest() { 184 void InitAndroidTest() {
185 InitAndroidTestLogging(); 185 InitAndroidTestLogging();
186 InitAndroidTestPaths(); 186 InitAndroidTestPaths();
187 InitAndroidTestMessageLoop(); 187 InitAndroidTestMessageLoop();
188 } 188 }
189 } // namespace base 189 } // namespace base
OLDNEW
« no previous file with comments | « base/test/test_suite.cc ('k') | base/threading/non_thread_safe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698