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

Side by Side Diff: content/child/worker_task_runner_unittest.cc

Issue 937313003: chrome: Remove the use of WebWorkerRunLoop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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 | « content/child/worker_task_runner.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/child/worker_task_runner.h" 5 #include "content/child/worker_task_runner.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 class WorkerTaskRunnerTest : public testing::Test { 14 class WorkerTaskRunnerTest : public testing::Test {
15 public: 15 public:
16 void FakeStart() { 16 void FakeStart() {
17 task_runner_.OnWorkerRunLoopStarted(blink::WebWorkerRunLoop()); 17 task_runner_.OnWorkerRunLoopStarted();
18 } 18 }
19 void FakeStop() { 19 void FakeStop() {
20 task_runner_.OnWorkerRunLoopStopped(blink::WebWorkerRunLoop()); 20 task_runner_.OnWorkerRunLoopStopped();
21 } 21 }
22 WorkerTaskRunner task_runner_; 22 WorkerTaskRunner task_runner_;
23 23
24 private: 24 private:
25 base::MessageLoop message_loop_; 25 base::MessageLoop message_loop_;
26 }; 26 };
27 27
28 class MockObserver : public WorkerTaskRunner::Observer { 28 class MockObserver : public WorkerTaskRunner::Observer {
29 public: 29 public:
30 MOCK_METHOD0(OnWorkerRunLoopStopped, void()); 30 MOCK_METHOD0(OnWorkerRunLoopStopped, void());
(...skipping 21 matching lines...) Expand all
52 MockObserver o; 52 MockObserver o;
53 o.RemoveSelfOnNotify(); 53 o.RemoveSelfOnNotify();
54 o.runner_ = &task_runner_; 54 o.runner_ = &task_runner_;
55 EXPECT_CALL(o, OnWorkerRunLoopStopped()).Times(1); 55 EXPECT_CALL(o, OnWorkerRunLoopStopped()).Times(1);
56 FakeStart(); 56 FakeStart();
57 task_runner_.AddStopObserver(&o); 57 task_runner_.AddStopObserver(&o);
58 FakeStop(); 58 FakeStop();
59 } 59 }
60 60
61 } // namespace content 61 } // namespace content
OLDNEW
« no previous file with comments | « content/child/worker_task_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698