OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ServiceWorkerContextCore::UnregistrationCallback MakeUnregisteredCallback( | 52 ServiceWorkerContextCore::UnregistrationCallback MakeUnregisteredCallback( |
53 bool* called) { | 53 bool* called) { |
54 return base::Bind(&CallCompletedCallback, called); | 54 return base::Bind(&CallCompletedCallback, called); |
55 } | 55 } |
56 | 56 |
57 void ExpectRegisteredWorkers( | 57 void ExpectRegisteredWorkers( |
58 ServiceWorkerStatusCode expect_status, | 58 ServiceWorkerStatusCode expect_status, |
59 bool expect_waiting, | 59 bool expect_waiting, |
60 bool expect_active, | 60 bool expect_active, |
61 ServiceWorkerStatusCode status, | 61 ServiceWorkerStatusCode status, |
62 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 62 scoped_refptr<ServiceWorkerRegistration> registration) { |
63 ASSERT_EQ(expect_status, status); | 63 ASSERT_EQ(expect_status, status); |
64 if (status != SERVICE_WORKER_OK) { | 64 if (status != SERVICE_WORKER_OK) { |
65 EXPECT_FALSE(registration.get()); | 65 EXPECT_FALSE(registration.get()); |
66 return; | 66 return; |
67 } | 67 } |
68 | 68 |
69 if (expect_waiting) { | 69 if (expect_waiting) { |
70 EXPECT_TRUE(registration->waiting_version()); | 70 EXPECT_TRUE(registration->waiting_version()); |
71 } else { | 71 } else { |
72 EXPECT_FALSE(registration->waiting_version()); | 72 EXPECT_FALSE(registration->waiting_version()); |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 EXPECT_EQ(pattern, notifications_[0].pattern); | 704 EXPECT_EQ(pattern, notifications_[0].pattern); |
705 EXPECT_EQ(registration_id, notifications_[0].registration_id); | 705 EXPECT_EQ(registration_id, notifications_[0].registration_id); |
706 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); | 706 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); |
707 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); | 707 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); |
708 EXPECT_EQ(pattern, notifications_[2].pattern); | 708 EXPECT_EQ(pattern, notifications_[2].pattern); |
709 EXPECT_EQ(registration_id, notifications_[2].registration_id); | 709 EXPECT_EQ(registration_id, notifications_[2].registration_id); |
710 } | 710 } |
711 | 711 |
712 | 712 |
713 } // namespace content | 713 } // namespace content |
OLD | NEW |