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

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

Issue 2061203002: WIP Reland: service worker: Don't control a subframe of an insecure context Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: maybe fix drmemory Created 4 years, 6 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 <tuple> 5 #include <tuple>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/service_worker/embedded_worker_registry.h" 10 #include "content/browser/service_worker/embedded_worker_registry.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; 100 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED;
101 helper_->context()->storage()->StoreRegistration( 101 helper_->context()->storage()->StoreRegistration(
102 registration_.get(), 102 registration_.get(),
103 version_.get(), 103 version_.get(),
104 CreateReceiverOnCurrentThread(&status)); 104 CreateReceiverOnCurrentThread(&status));
105 base::RunLoop().RunUntilIdle(); 105 base::RunLoop().RunUntilIdle();
106 ASSERT_EQ(SERVICE_WORKER_OK, status); 106 ASSERT_EQ(SERVICE_WORKER_OK, status);
107 107
108 provider_host_.reset(new ServiceWorkerProviderHost( 108 provider_host_.reset(new ServiceWorkerProviderHost(
109 helper_->mock_render_process_id(), kRenderFrameId, 1, 109 helper_->mock_render_process_id(), kRenderFrameId, 1,
110 SERVICE_WORKER_PROVIDER_FOR_WINDOW, helper_->context()->AsWeakPtr(), 110 SERVICE_WORKER_PROVIDER_FOR_WINDOW,
111 dispatcher_host_.get())); 111 ServiceWorkerProviderHost::FrameSecurityLevel::SECURE,
112 helper_->context()->AsWeakPtr(), dispatcher_host_.get()));
112 113
113 helper_->SimulateAddProcessToPattern(pattern, 114 helper_->SimulateAddProcessToPattern(pattern,
114 helper_->mock_render_process_id()); 115 helper_->mock_render_process_id());
115 } 116 }
116 117
117 void TearDown() override { 118 void TearDown() override {
118 dispatcher_host_ = NULL; 119 dispatcher_host_ = NULL;
119 registration_ = NULL; 120 registration_ = NULL;
120 version_ = NULL; 121 version_ = NULL;
121 provider_host_.reset(); 122 provider_host_.reset();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 VerifyStateChangedMessage(handle->handle_id(), 166 VerifyStateChangedMessage(handle->handle_id(),
166 blink::WebServiceWorkerStateInstalling, 167 blink::WebServiceWorkerStateInstalling,
167 ipc_sink()->GetMessageAt(1)); 168 ipc_sink()->GetMessageAt(1));
168 // 3. StateChanged (state == Installed). 169 // 3. StateChanged (state == Installed).
169 VerifyStateChangedMessage(handle->handle_id(), 170 VerifyStateChangedMessage(handle->handle_id(),
170 blink::WebServiceWorkerStateInstalled, 171 blink::WebServiceWorkerStateInstalled,
171 ipc_sink()->GetMessageAt(2)); 172 ipc_sink()->GetMessageAt(2));
172 } 173 }
173 174
174 } // namespace content 175 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698