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

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

Issue 292903002: Save running SW instance info, including its SiteInstance, into the ProcessManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/public/browser/service_worker_context.h" 5 #include "content/public/browser/service_worker_context.h"
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "content/browser/browser_thread_impl.h" 10 #include "content/browser/browser_thread_impl.h"
(...skipping 11 matching lines...) Expand all
22 namespace content { 22 namespace content {
23 23
24 namespace { 24 namespace {
25 25
26 void SaveResponseCallback(bool* called, 26 void SaveResponseCallback(bool* called,
27 int64* store_registration_id, 27 int64* store_registration_id,
28 int64* store_version_id, 28 int64* store_version_id,
29 ServiceWorkerStatusCode status, 29 ServiceWorkerStatusCode status,
30 int64 registration_id, 30 int64 registration_id,
31 int64 version_id) { 31 int64 version_id) {
32 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status);
32 *called = true; 33 *called = true;
33 *store_registration_id = registration_id; 34 *store_registration_id = registration_id;
34 *store_version_id = version_id; 35 *store_version_id = version_id;
35 } 36 }
36 37
37 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback( 38 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback(
38 bool* called, 39 bool* called,
39 int64* store_registration_id, 40 int64* store_registration_id,
40 int64* store_version_id) { 41 int64* store_version_id) {
41 return base::Bind(&SaveResponseCallback, called, 42 return base::Bind(&SaveResponseCallback, called,
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id)); 376 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id));
376 377
377 ASSERT_FALSE(called); 378 ASSERT_FALSE(called);
378 base::RunLoop().RunUntilIdle(); 379 base::RunLoop().RunUntilIdle();
379 ASSERT_TRUE(called); 380 ASSERT_TRUE(called);
380 EXPECT_EQ(old_registration_id, new_registration_id); 381 EXPECT_EQ(old_registration_id, new_registration_id);
381 EXPECT_EQ(old_version_id, new_version_id); 382 EXPECT_EQ(old_version_id, new_version_id);
382 } 383 }
383 384
384 } // namespace content 385 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698