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

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

Issue 1149383004: [3/5 chromium] Shows the clients which are controlled by ServiceWorker in DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 } 596 }
597 597
598 void TimeoutWorkerOnIOThread() { 598 void TimeoutWorkerOnIOThread() {
599 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 599 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
600 version_->SimulatePingTimeoutForTesting(); 600 version_->SimulatePingTimeoutForTesting();
601 } 601 }
602 602
603 void AddControlleeOnIOThread() { 603 void AddControlleeOnIOThread() {
604 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 604 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
605 scoped_ptr<ServiceWorkerProviderHost> host(new ServiceWorkerProviderHost( 605 scoped_ptr<ServiceWorkerProviderHost> host(new ServiceWorkerProviderHost(
606 33 /* dummy render process id */, 606 33 /* dummy render process id */, 1 /* dummy render_frame_id */,
607 MSG_ROUTING_NONE /* render_frame_id */, 1 /* dummy provider_id */, 607 MSG_ROUTING_NONE /* shared_worker_route_id */,
608 SERVICE_WORKER_PROVIDER_FOR_WINDOW, wrapper()->context()->AsWeakPtr(), 608 1 /* dummy provider_id */, wrapper()->context()->AsWeakPtr(), NULL));
609 NULL));
610 host->SetDocumentUrl( 609 host->SetDocumentUrl(
611 embedded_test_server()->GetURL("/service_worker/host")); 610 embedded_test_server()->GetURL("/service_worker/host"));
612 host->AssociateRegistration(registration_.get(), 611 host->AssociateRegistration(registration_.get(),
613 false /* notify_controllerchange */); 612 false /* notify_controllerchange */);
614 wrapper()->context()->AddProviderHost(host.Pass()); 613 wrapper()->context()->AddProviderHost(host.Pass());
615 } 614 }
616 615
617 void AddWaitingWorkerOnIOThread(const std::string& worker_url) { 616 void AddWaitingWorkerOnIOThread(const std::string& worker_url) {
618 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 617 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
619 scoped_refptr<ServiceWorkerVersion> waiting_version( 618 scoped_refptr<ServiceWorkerVersion> waiting_version(
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 ASSERT_EQ(SERVICE_WORKER_OK, status); 1484 ASSERT_EQ(SERVICE_WORKER_OK, status);
1486 // Stop the worker. 1485 // Stop the worker.
1487 StopWorker(SERVICE_WORKER_OK); 1486 StopWorker(SERVICE_WORKER_OK);
1488 // Restart the worker. 1487 // Restart the worker.
1489 StartWorker(SERVICE_WORKER_OK); 1488 StartWorker(SERVICE_WORKER_OK);
1490 // Stop the worker. 1489 // Stop the worker.
1491 StopWorker(SERVICE_WORKER_OK); 1490 StopWorker(SERVICE_WORKER_OK);
1492 } 1491 }
1493 1492
1494 } // namespace content 1493 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698