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

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

Issue 2824193002: Enable use_once_callback for //content/common/*.mojom (Closed)
Patch Set: rebase Created 3 years, 8 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 embedded_worker_id, request_id, 91 embedded_worker_id, request_id,
92 blink::kWebServiceWorkerEventResultRejected, true, base::Time::Now())); 92 blink::kWebServiceWorkerEventResultRejected, true, base::Time::Now()));
93 } 93 }
94 }; 94 };
95 95
96 class RejectActivateTestHelper : public EmbeddedWorkerTestHelper { 96 class RejectActivateTestHelper : public EmbeddedWorkerTestHelper {
97 public: 97 public:
98 RejectActivateTestHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} 98 RejectActivateTestHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {}
99 99
100 void OnActivateEvent( 100 void OnActivateEvent(
101 const mojom::ServiceWorkerEventDispatcher::DispatchActivateEventCallback& 101 mojom::ServiceWorkerEventDispatcher::DispatchActivateEventCallback
102 callback) override { 102 callback) override {
103 dispatched_events()->push_back(Event::Activate); 103 dispatched_events()->push_back(Event::Activate);
104 callback.Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED, 104 std::move(callback).Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
105 base::Time::Now()); 105 base::Time::Now());
106 } 106 }
107 }; 107 };
108 108
109 enum NotificationType { 109 enum NotificationType {
110 REGISTRATION_STORED, 110 REGISTRATION_STORED,
111 REGISTRATION_DELETED, 111 REGISTRATION_DELETED,
112 STORAGE_RECOVERED, 112 STORAGE_RECOVERED,
113 }; 113 };
114 114
115 struct NotificationLog { 115 struct NotificationLog {
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); 761 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type);
762 EXPECT_EQ(pattern, notifications_[2].pattern); 762 EXPECT_EQ(pattern, notifications_[2].pattern);
763 EXPECT_EQ(registration_id, notifications_[2].registration_id); 763 EXPECT_EQ(registration_id, notifications_[2].registration_id);
764 } 764 }
765 765
766 INSTANTIATE_TEST_CASE_P(ServiceWorkerContextRecoveryTest, 766 INSTANTIATE_TEST_CASE_P(ServiceWorkerContextRecoveryTest,
767 ServiceWorkerContextRecoveryTest, 767 ServiceWorkerContextRecoveryTest,
768 testing::Bool()); 768 testing::Bool());
769 769
770 } // namespace content 770 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698