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

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

Issue 2055433002: Revert of service worker: Don't control a subframe of an insecure context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 <stdint.h> 5 #include <stdint.h>
6 #include <tuple> 6 #include <tuple>
7 7
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 EXPECT_FALSE(called); 179 EXPECT_FALSE(called);
180 base::RunLoop().RunUntilIdle(); 180 base::RunLoop().RunUntilIdle();
181 EXPECT_TRUE(called); 181 EXPECT_TRUE(called);
182 return registration; 182 return registration;
183 } 183 }
184 184
185 std::unique_ptr<ServiceWorkerProviderHost> 185 std::unique_ptr<ServiceWorkerProviderHost>
186 ServiceWorkerJobTest::CreateControllee() { 186 ServiceWorkerJobTest::CreateControllee() {
187 return std::unique_ptr<ServiceWorkerProviderHost>( 187 return std::unique_ptr<ServiceWorkerProviderHost>(
188 new ServiceWorkerProviderHost( 188 new ServiceWorkerProviderHost(33 /* dummy render_process id */,
189 33 /* dummy render_process id */, 189 MSG_ROUTING_NONE /* render_frame_id */,
190 MSG_ROUTING_NONE /* render_frame_id */, 1 /* dummy provider_id */, 190 1 /* dummy provider_id */,
191 SERVICE_WORKER_PROVIDER_FOR_WINDOW, 191 SERVICE_WORKER_PROVIDER_FOR_WINDOW,
192 ServiceWorkerProviderHost::FrameSecurityLevel::SECURE, 192 helper_->context()->AsWeakPtr(), NULL));
193 helper_->context()->AsWeakPtr(), NULL));
194 } 193 }
195 194
196 TEST_F(ServiceWorkerJobTest, SameDocumentSameRegistration) { 195 TEST_F(ServiceWorkerJobTest, SameDocumentSameRegistration) {
197 scoped_refptr<ServiceWorkerRegistration> original_registration = 196 scoped_refptr<ServiceWorkerRegistration> original_registration =
198 RunRegisterJob(GURL("http://www.example.com/"), 197 RunRegisterJob(GURL("http://www.example.com/"),
199 GURL("http://www.example.com/service_worker.js")); 198 GURL("http://www.example.com/service_worker.js"));
200 bool called; 199 bool called;
201 scoped_refptr<ServiceWorkerRegistration> registration1; 200 scoped_refptr<ServiceWorkerRegistration> registration1;
202 storage()->FindRegistrationForDocument( 201 storage()->FindRegistrationForDocument(
203 GURL("http://www.example.com/"), 202 GURL("http://www.example.com/"),
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 // should not be promoted to ACTIVATED because failure occur 1688 // should not be promoted to ACTIVATED because failure occur
1690 // during shutdown. 1689 // during shutdown.
1691 runner->RunUntilIdle(); 1690 runner->RunUntilIdle();
1692 base::RunLoop().RunUntilIdle(); 1691 base::RunLoop().RunUntilIdle();
1693 EXPECT_EQ(new_version.get(), registration->active_version()); 1692 EXPECT_EQ(new_version.get(), registration->active_version());
1694 EXPECT_EQ(ServiceWorkerVersion::ACTIVATING, new_version->status()); 1693 EXPECT_EQ(ServiceWorkerVersion::ACTIVATING, new_version->status());
1695 registration->RemoveListener(update_helper); 1694 registration->RemoveListener(update_helper);
1696 } 1695 }
1697 1696
1698 } // namespace content 1697 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698