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

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

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix IPC Created 3 years, 4 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 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 EXPECT_TRUE(registration->waiting_version()); 73 EXPECT_TRUE(registration->waiting_version());
74 } else { 74 } else {
75 EXPECT_FALSE(registration->waiting_version()); 75 EXPECT_FALSE(registration->waiting_version());
76 } 76 }
77 77
78 if (expect_active) { 78 if (expect_active) {
79 EXPECT_TRUE(registration->active_version()); 79 EXPECT_TRUE(registration->active_version());
80 } else { 80 } else {
81 EXPECT_FALSE(registration->active_version()); 81 EXPECT_FALSE(registration->active_version());
82 } 82 }
83
84 EXPECT_EQ(blink::WebServiceWorkerUpdateViaCache::kImports,
85 registration->update_via_cache());
83 } 86 }
84 87
85 class RejectInstallTestHelper : public EmbeddedWorkerTestHelper { 88 class RejectInstallTestHelper : public EmbeddedWorkerTestHelper {
86 public: 89 public:
87 RejectInstallTestHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} 90 RejectInstallTestHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {}
88 91
89 void OnInstallEvent( 92 void OnInstallEvent(
90 mojom::ServiceWorkerInstallEventMethodsAssociatedPtrInfo client, 93 mojom::ServiceWorkerInstallEventMethodsAssociatedPtrInfo client,
91 mojom::ServiceWorkerEventDispatcher::DispatchInstallEventCallback 94 mojom::ServiceWorkerEventDispatcher::DispatchInstallEventCallback
92 callback) override { 95 callback) override {
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); 769 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type);
767 EXPECT_EQ(pattern, notifications_[2].pattern); 770 EXPECT_EQ(pattern, notifications_[2].pattern);
768 EXPECT_EQ(registration_id, notifications_[2].registration_id); 771 EXPECT_EQ(registration_id, notifications_[2].registration_id);
769 } 772 }
770 773
771 INSTANTIATE_TEST_CASE_P(ServiceWorkerContextRecoveryTest, 774 INSTANTIATE_TEST_CASE_P(ServiceWorkerContextRecoveryTest,
772 ServiceWorkerContextRecoveryTest, 775 ServiceWorkerContextRecoveryTest,
773 testing::Bool() /* is_storage_on_disk */); 776 testing::Bool() /* is_storage_on_disk */);
774 777
775 } // namespace content 778 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698