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

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

Issue 188283003: Add ServiceWorkerVersion::status() (which is to be persisted unlike running status) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix after rebase Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_register_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/service_worker/embedded_worker_instance.h" 9 #include "content/browser/service_worker/embedded_worker_instance.h"
10 #include "content/browser/service_worker/embedded_worker_registry.h" 10 #include "content/browser/service_worker/embedded_worker_registry.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 version_->DispatchInstallEvent( 288 version_->DispatchInstallEvent(
289 -1, CreateReceiver(BrowserThread::UI, done, result)); 289 -1, CreateReceiver(BrowserThread::UI, done, result));
290 } 290 }
291 291
292 void FetchOnIOThread(const base::Closure& done, FetchResult* result) { 292 void FetchOnIOThread(const base::Closure& done, FetchResult* result) {
293 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 293 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
294 ServiceWorkerFetchRequest request( 294 ServiceWorkerFetchRequest request(
295 embedded_test_server()->GetURL("/service_worker/empty.html"), 295 embedded_test_server()->GetURL("/service_worker/empty.html"),
296 "GET", 296 "GET",
297 std::map<std::string, std::string>()); 297 std::map<std::string, std::string>());
298 version_->set_status(ServiceWorkerVersion::ACTIVE);
298 version_->DispatchFetchEvent( 299 version_->DispatchFetchEvent(
299 request, CreateResponseReceiver(BrowserThread::UI, done, result)); 300 request, CreateResponseReceiver(BrowserThread::UI, done, result));
300 } 301 }
301 302
302 void StopOnIOThread(const base::Closure& done, 303 void StopOnIOThread(const base::Closure& done,
303 ServiceWorkerStatusCode* result) { 304 ServiceWorkerStatusCode* result) {
304 ASSERT_TRUE(version_); 305 ASSERT_TRUE(version_);
305 version_->StopWorker(CreateReceiver(BrowserThread::UI, done, result)); 306 version_->StopWorker(CreateReceiver(BrowserThread::UI, done, result));
306 } 307 }
307 308
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 410 }
410 411
411 IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, FetchEvent_Rejected) { 412 IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, FetchEvent_Rejected) {
412 ServiceWorkerFetchEventResult result; 413 ServiceWorkerFetchEventResult result;
413 ServiceWorkerResponse response; 414 ServiceWorkerResponse response;
414 FetchTestHelper("/service_worker/fetch_event_error.js", &result, &response); 415 FetchTestHelper("/service_worker/fetch_event_error.js", &result, &response);
415 ASSERT_EQ(SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, result); 416 ASSERT_EQ(SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, result);
416 } 417 }
417 418
418 } // namespace content 419 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_register_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698