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

Side by Side Diff: content/browser/shared_worker/shared_worker_service_impl_unittest.cc

Issue 635503002: Replacing the OVERRIDE with override and FINAL with final in content/browser/shared_worker (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
« no previous file with comments | « content/browser/shared_worker/shared_worker_service_impl.h ('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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 NULL, 53 NULL,
54 NULL)) { 54 NULL)) {
55 SharedWorkerServiceImpl::GetInstance() 55 SharedWorkerServiceImpl::GetInstance()
56 ->ChangeUpdateWorkerDependencyFuncForTesting( 56 ->ChangeUpdateWorkerDependencyFuncForTesting(
57 &SharedWorkerServiceImplTest::MockUpdateWorkerDependency); 57 &SharedWorkerServiceImplTest::MockUpdateWorkerDependency);
58 SharedWorkerServiceImpl::GetInstance() 58 SharedWorkerServiceImpl::GetInstance()
59 ->ChangeTryIncrementWorkerRefCountFuncForTesting( 59 ->ChangeTryIncrementWorkerRefCountFuncForTesting(
60 &SharedWorkerServiceImplTest::MockTryIncrementWorkerRefCount); 60 &SharedWorkerServiceImplTest::MockTryIncrementWorkerRefCount);
61 } 61 }
62 62
63 virtual void SetUp() OVERRIDE {} 63 virtual void SetUp() override {}
64 virtual void TearDown() OVERRIDE { 64 virtual void TearDown() override {
65 s_update_worker_dependency_call_count_ = 0; 65 s_update_worker_dependency_call_count_ = 0;
66 s_worker_dependency_added_ids_.clear(); 66 s_worker_dependency_added_ids_.clear();
67 s_worker_dependency_removed_ids_.clear(); 67 s_worker_dependency_removed_ids_.clear();
68 s_running_process_id_set_.clear(); 68 s_running_process_id_set_.clear();
69 SharedWorkerServiceImpl::GetInstance()->ResetForTesting(); 69 SharedWorkerServiceImpl::GetInstance()->ResetForTesting();
70 } 70 }
71 static void MockUpdateWorkerDependency(const std::vector<int>& added_ids, 71 static void MockUpdateWorkerDependency(const std::vector<int>& added_ids,
72 const std::vector<int>& removed_ids) { 72 const std::vector<int>& removed_ids) {
73 ++s_update_worker_dependency_call_count_; 73 ++s_update_worker_dependency_call_count_;
74 s_worker_dependency_added_ids_ = added_ids; 74 s_worker_dependency_added_ids_ = added_ids;
(...skipping 28 matching lines...) Expand all
103 static const int kProcessIDs[] = {100, 101, 102}; 103 static const int kProcessIDs[] = {100, 101, 102};
104 static const unsigned long long kDocumentIDs[] = {200, 201, 202}; 104 static const unsigned long long kDocumentIDs[] = {200, 201, 202};
105 static const int kRenderFrameRouteIDs[] = {300, 301, 302}; 105 static const int kRenderFrameRouteIDs[] = {300, 301, 302};
106 106
107 class MockMessagePortMessageFilter : public MessagePortMessageFilter { 107 class MockMessagePortMessageFilter : public MessagePortMessageFilter {
108 public: 108 public:
109 MockMessagePortMessageFilter(const NextRoutingIDCallback& callback, 109 MockMessagePortMessageFilter(const NextRoutingIDCallback& callback,
110 ScopedVector<IPC::Message>* message_queue) 110 ScopedVector<IPC::Message>* message_queue)
111 : MessagePortMessageFilter(callback), message_queue_(message_queue) {} 111 : MessagePortMessageFilter(callback), message_queue_(message_queue) {}
112 112
113 virtual bool Send(IPC::Message* message) OVERRIDE { 113 virtual bool Send(IPC::Message* message) override {
114 if (!message_queue_) { 114 if (!message_queue_) {
115 delete message; 115 delete message;
116 return false; 116 return false;
117 } 117 }
118 message_queue_->push_back(message); 118 message_queue_->push_back(message);
119 return true; 119 return true;
120 } 120 }
121 121
122 void Close() { 122 void Close() {
123 message_queue_ = NULL; 123 message_queue_ = NULL;
(...skipping 11 matching lines...) Expand all
135 ResourceContext* resource_context, 135 ResourceContext* resource_context,
136 const WorkerStoragePartition& partition, 136 const WorkerStoragePartition& partition,
137 MessagePortMessageFilter* message_port_filter, 137 MessagePortMessageFilter* message_port_filter,
138 ScopedVector<IPC::Message>* message_queue) 138 ScopedVector<IPC::Message>* message_queue)
139 : SharedWorkerMessageFilter(render_process_id, 139 : SharedWorkerMessageFilter(render_process_id,
140 resource_context, 140 resource_context,
141 partition, 141 partition,
142 message_port_filter), 142 message_port_filter),
143 message_queue_(message_queue) {} 143 message_queue_(message_queue) {}
144 144
145 virtual bool Send(IPC::Message* message) OVERRIDE { 145 virtual bool Send(IPC::Message* message) override {
146 if (!message_queue_) { 146 if (!message_queue_) {
147 delete message; 147 delete message;
148 return false; 148 return false;
149 } 149 }
150 message_queue_->push_back(message); 150 message_queue_->push_back(message);
151 return true; 151 return true;
152 } 152 }
153 153
154 void Close() { 154 void Close() {
155 message_queue_ = NULL; 155 message_queue_ = NULL;
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 kDocumentIDs[2], 908 kDocumentIDs[2],
909 kRenderFrameRouteIDs[2]); 909 kRenderFrameRouteIDs[2]);
910 EXPECT_NE(MSG_ROUTING_NONE, connector2->route_id()); 910 EXPECT_NE(MSG_ROUTING_NONE, connector2->route_id());
911 EXPECT_EQ(0U, renderer_host2->QueuedMessageCount()); 911 EXPECT_EQ(0U, renderer_host2->QueuedMessageCount());
912 RunAllPendingInMessageLoop(); 912 RunAllPendingInMessageLoop();
913 EXPECT_EQ(1U, renderer_host2->QueuedMessageCount()); 913 EXPECT_EQ(1U, renderer_host2->QueuedMessageCount());
914 CheckViewMsgWorkerCreated(renderer_host2.get(), connector2.get()); 914 CheckViewMsgWorkerCreated(renderer_host2.get(), connector2.get());
915 } 915 }
916 916
917 } // namespace content 917 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/shared_worker/shared_worker_service_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698