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/service_worker_browsertest.cc

Issue 2009453002: service worker: Don't control a subframe of an insecure context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor errorMessage 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 521 }
522 522
523 void TimeoutWorkerOnIOThread() { 523 void TimeoutWorkerOnIOThread() {
524 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 524 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
525 version_->SimulatePingTimeoutForTesting(); 525 version_->SimulatePingTimeoutForTesting();
526 } 526 }
527 527
528 void AddControlleeOnIOThread() { 528 void AddControlleeOnIOThread() {
529 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 529 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
530 std::unique_ptr<ServiceWorkerProviderHost> host( 530 std::unique_ptr<ServiceWorkerProviderHost> host(
531 new ServiceWorkerProviderHost(33 /* dummy render process id */, 531 new ServiceWorkerProviderHost(
532 MSG_ROUTING_NONE /* render_frame_id */, 532 33 /* dummy render process id */,
533 1 /* dummy provider_id */, 533 MSG_ROUTING_NONE /* render_frame_id */, 1 /* dummy provider_id */,
534 SERVICE_WORKER_PROVIDER_FOR_WINDOW, 534 SERVICE_WORKER_PROVIDER_FOR_WINDOW,
535 wrapper()->context()->AsWeakPtr(), NULL)); 535 ServiceWorkerProviderHost::FrameSecurityLevel::SECURE,
536 wrapper()->context()->AsWeakPtr(), NULL));
536 host->SetDocumentUrl( 537 host->SetDocumentUrl(
537 embedded_test_server()->GetURL("/service_worker/host")); 538 embedded_test_server()->GetURL("/service_worker/host"));
538 host->AssociateRegistration(registration_.get(), 539 host->AssociateRegistration(registration_.get(),
539 false /* notify_controllerchange */); 540 false /* notify_controllerchange */);
540 wrapper()->context()->AddProviderHost(std::move(host)); 541 wrapper()->context()->AddProviderHost(std::move(host));
541 } 542 }
542 543
543 void AddWaitingWorkerOnIOThread(const std::string& worker_url) { 544 void AddWaitingWorkerOnIOThread(const std::string& worker_url) {
544 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 545 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
545 scoped_refptr<ServiceWorkerVersion> waiting_version( 546 scoped_refptr<ServiceWorkerVersion> waiting_version(
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 NavigateToTestPage(); 1866 NavigateToTestPage();
1866 // The V8 code cache must be stored to the CacheStorage which must be bigger 1867 // The V8 code cache must be stored to the CacheStorage which must be bigger
1867 // than 12 byte. 1868 // than 12 byte.
1868 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); 1869 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize);
1869 1870
1870 NavigateToTestPage(); 1871 NavigateToTestPage();
1871 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); 1872 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize);
1872 } 1873 }
1873 1874
1874 } // namespace content 1875 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/extensions/service_worker_apitest.cc ('k') | content/browser/service_worker/service_worker_context_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698