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

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

Issue 605163002: Service Worker: Remove legacy code for resolving register() to a version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: only resolve on active_version Created 6 years, 2 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/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/browser/browser_thread_impl.h" 8 #include "content/browser/browser_thread_impl.h"
9 #include "content/browser/service_worker/embedded_worker_registry.h" 9 #include "content/browser/service_worker/embedded_worker_registry.h"
10 #include "content/browser/service_worker/embedded_worker_test_helper.h" 10 #include "content/browser/service_worker/embedded_worker_test_helper.h"
(...skipping 20 matching lines...) Expand all
31 31
32 namespace { 32 namespace {
33 33
34 int kMockRenderProcessId = 88; 34 int kMockRenderProcessId = 88;
35 35
36 void SaveRegistrationCallback( 36 void SaveRegistrationCallback(
37 ServiceWorkerStatusCode expected_status, 37 ServiceWorkerStatusCode expected_status,
38 bool* called, 38 bool* called,
39 scoped_refptr<ServiceWorkerRegistration>* registration_out, 39 scoped_refptr<ServiceWorkerRegistration>* registration_out,
40 ServiceWorkerStatusCode status, 40 ServiceWorkerStatusCode status,
41 ServiceWorkerRegistration* registration, 41 ServiceWorkerRegistration* registration) {
42 ServiceWorkerVersion* version) {
43 ASSERT_TRUE(!version || version->registration_id() == registration->id())
44 << version << " " << registration;
45 EXPECT_EQ(expected_status, status); 42 EXPECT_EQ(expected_status, status);
46 *called = true; 43 *called = true;
47 *registration_out = registration; 44 *registration_out = registration;
48 } 45 }
49 46
50 void SaveFoundRegistrationCallback( 47 void SaveFoundRegistrationCallback(
51 ServiceWorkerStatusCode expected_status, 48 ServiceWorkerStatusCode expected_status,
52 bool* called, 49 bool* called,
53 scoped_refptr<ServiceWorkerRegistration>* registration, 50 scoped_refptr<ServiceWorkerRegistration>* registration,
54 ServiceWorkerStatusCode status, 51 ServiceWorkerStatusCode status,
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 EXPECT_TRUE(called); 1190 EXPECT_TRUE(called);
1194 1191
1195 // Verify the registration was not modified by the Update. 1192 // Verify the registration was not modified by the Update.
1196 EXPECT_TRUE(registration->is_uninstalling()); 1193 EXPECT_TRUE(registration->is_uninstalling());
1197 EXPECT_EQ(active_version, registration->active_version()); 1194 EXPECT_EQ(active_version, registration->active_version());
1198 EXPECT_EQ(NULL, registration->waiting_version()); 1195 EXPECT_EQ(NULL, registration->waiting_version());
1199 EXPECT_EQ(NULL, registration->installing_version()); 1196 EXPECT_EQ(NULL, registration->installing_version());
1200 } 1197 }
1201 1198
1202 } // namespace content 1199 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698