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

Side by Side Diff: content/browser/service_worker/embedded_worker_test_helper.cc

Issue 2429753003: Mojofy unittests: ServiceWorkerJobTest (Closed)
Patch Set: Created 4 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 "content/browser/service_worker/embedded_worker_test_helper.h" 5 #include "content/browser/service_worker/embedded_worker_test_helper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 void EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::StopWorker( 114 void EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::StopWorker(
115 const StopWorkerCallback& callback) { 115 const StopWorkerCallback& callback) {
116 if (!helper_) 116 if (!helper_)
117 return; 117 return;
118 118
119 ASSERT_TRUE(embedded_worker_id_); 119 ASSERT_TRUE(embedded_worker_id_);
120 EmbeddedWorkerInstance* worker = 120 EmbeddedWorkerInstance* worker =
121 helper_->registry()->GetWorker(embedded_worker_id_.value()); 121 helper_->registry()->GetWorker(embedded_worker_id_.value());
122 ASSERT_TRUE(worker != NULL); 122 // |worker| is possible to be null when corresponding EmbeddedWorkerInstance
123 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, worker->status()); 123 // is removed right after sending StopWorker.
124 124 if (worker)
125 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, worker->status());
125 callback.Run(); 126 callback.Run();
126 } 127 }
127 128
128 // static 129 // static
129 void EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::Bind( 130 void EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::Bind(
130 const base::WeakPtr<EmbeddedWorkerTestHelper>& helper, 131 const base::WeakPtr<EmbeddedWorkerTestHelper>& helper,
131 mojom::EmbeddedWorkerInstanceClientRequest request) { 132 mojom::EmbeddedWorkerInstanceClientRequest request) {
132 std::vector<std::unique_ptr<MockEmbeddedWorkerInstanceClient>>* clients = 133 std::vector<std::unique_ptr<MockEmbeddedWorkerInstanceClient>>* clients =
133 helper->mock_instance_clients(); 134 helper->mock_instance_clients();
134 size_t next_client_index = helper->mock_instance_clients_next_index_; 135 size_t next_client_index = helper->mock_instance_clients_next_index_;
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 registry->Bind(mojo::GetProxy(&interfaces)); 558 registry->Bind(mojo::GetProxy(&interfaces));
558 559
559 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces( 560 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces(
560 new service_manager::InterfaceProvider); 561 new service_manager::InterfaceProvider);
561 remote_interfaces->Bind(std::move(interfaces)); 562 remote_interfaces->Bind(std::move(interfaces));
562 rph->SetRemoteInterfaces(std::move(remote_interfaces)); 563 rph->SetRemoteInterfaces(std::move(remote_interfaces));
563 return registry; 564 return registry;
564 } 565 }
565 566
566 } // namespace content 567 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698