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

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: added more statuses 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
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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 259 }
260 260
261 void FetchOnIOThread(const base::Closure& done, 261 void FetchOnIOThread(const base::Closure& done,
262 ServiceWorkerStatusCode* result, 262 ServiceWorkerStatusCode* result,
263 ServiceWorkerFetchResponse* message) { 263 ServiceWorkerFetchResponse* message) {
264 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 264 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
265 ServiceWorkerFetchRequest request( 265 ServiceWorkerFetchRequest request(
266 embedded_test_server()->GetURL("/service_worker/empty.html"), 266 embedded_test_server()->GetURL("/service_worker/empty.html"),
267 "GET", 267 "GET",
268 std::map<std::string, std::string>()); 268 std::map<std::string, std::string>());
269 version_->set_status(ServiceWorkerVersion::ACTIVE);
269 version_->DispatchFetchEvent( 270 version_->DispatchFetchEvent(
270 request, 271 request,
271 CreateFetchResponseReceiver(BrowserThread::UI, done, result, message)); 272 CreateFetchResponseReceiver(BrowserThread::UI, done, result, message));
272 } 273 }
273 274
274 275
275 void StopOnIOThread(const base::Closure& done, 276 void StopOnIOThread(const base::Closure& done,
276 ServiceWorkerStatusCode* result) { 277 ServiceWorkerStatusCode* result) {
277 ASSERT_TRUE(version_); 278 ASSERT_TRUE(version_);
278 version_->StopWorker(CreateReceiver(BrowserThread::UI, done, result)); 279 version_->StopWorker(CreateReceiver(BrowserThread::UI, done, result));
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 fetch_run_loop.Run(); 375 fetch_run_loop.Run();
375 ASSERT_EQ(SERVICE_WORKER_OK, status); 376 ASSERT_EQ(SERVICE_WORKER_OK, status);
376 ASSERT_EQ(200, response.status_code); 377 ASSERT_EQ(200, response.status_code);
377 ASSERT_EQ("OK", response.status_text); 378 ASSERT_EQ("OK", response.status_text);
378 ASSERT_EQ("GET", response.method); 379 ASSERT_EQ("GET", response.method);
379 std::map<std::string, std::string> expected_headers; 380 std::map<std::string, std::string> expected_headers;
380 ASSERT_EQ(expected_headers, response.headers); 381 ASSERT_EQ(expected_headers, response.headers);
381 } 382 }
382 383
383 } // namespace content 384 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698