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

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: Move API change to another patch and address comments Created 3 years, 5 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 EXPECT_TRUE(registration->waiting_version()); 72 EXPECT_TRUE(registration->waiting_version());
73 } else { 73 } else {
74 EXPECT_FALSE(registration->waiting_version()); 74 EXPECT_FALSE(registration->waiting_version());
75 } 75 }
76 76
77 if (expect_active) { 77 if (expect_active) {
78 EXPECT_TRUE(registration->active_version()); 78 EXPECT_TRUE(registration->active_version());
79 } else { 79 } else {
80 EXPECT_FALSE(registration->active_version()); 80 EXPECT_FALSE(registration->active_version());
81 } 81 }
82
83 EXPECT_EQ(blink::WebServiceWorkerUpdateViaCache::kImports,
84 registration->update_via_cache());
82 } 85 }
83 86
84 class RejectInstallTestHelper : public EmbeddedWorkerTestHelper { 87 class RejectInstallTestHelper : public EmbeddedWorkerTestHelper {
85 public: 88 public:
86 RejectInstallTestHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} 89 RejectInstallTestHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {}
87 90
88 void OnInstallEvent( 91 void OnInstallEvent(
89 mojom::ServiceWorkerInstallEventMethodsAssociatedPtrInfo client, 92 mojom::ServiceWorkerInstallEventMethodsAssociatedPtrInfo client,
90 mojom::ServiceWorkerEventDispatcher::DispatchInstallEventCallback 93 mojom::ServiceWorkerEventDispatcher::DispatchInstallEventCallback
91 callback) override { 94 callback) override {
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); 751 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type);
749 EXPECT_EQ(pattern, notifications_[2].pattern); 752 EXPECT_EQ(pattern, notifications_[2].pattern);
750 EXPECT_EQ(registration_id, notifications_[2].registration_id); 753 EXPECT_EQ(registration_id, notifications_[2].registration_id);
751 } 754 }
752 755
753 INSTANTIATE_TEST_CASE_P(ServiceWorkerContextRecoveryTest, 756 INSTANTIATE_TEST_CASE_P(ServiceWorkerContextRecoveryTest,
754 ServiceWorkerContextRecoveryTest, 757 ServiceWorkerContextRecoveryTest,
755 testing::Bool()); 758 testing::Bool());
756 759
757 } // namespace content 760 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698