Chromium Code Reviews| 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 "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 render_process_id_(99) {} | 124 render_process_id_(99) {} |
| 125 | 125 |
| 126 void SetUp() override { | 126 void SetUp() override { |
| 127 helper_.reset(new EmbeddedWorkerTestHelper(render_process_id_)); | 127 helper_.reset(new EmbeddedWorkerTestHelper(render_process_id_)); |
| 128 helper_->context_wrapper()->AddObserver(this); | 128 helper_->context_wrapper()->AddObserver(this); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void TearDown() override { helper_.reset(); } | 131 void TearDown() override { helper_.reset(); } |
| 132 | 132 |
| 133 // ServiceWorkerContextObserver overrides. | 133 // ServiceWorkerContextObserver overrides. |
| 134 void OnRegistrationStored(const GURL& pattern) override { | 134 void OnRegistrationStored(int64 registration_id, |
|
Kunihiko Sakamoto
2015/03/10 05:38:08
Can you update existing tests to verify that regis
horo
2015/03/11 00:32:33
Done.
| |
| 135 const GURL& pattern) override { | |
| 135 NotificationLog log; | 136 NotificationLog log; |
| 136 log.type = REGISTRATION_STORED; | 137 log.type = REGISTRATION_STORED; |
| 137 log.pattern = pattern; | 138 log.pattern = pattern; |
| 138 notifications_.push_back(log); | 139 notifications_.push_back(log); |
| 139 } | 140 } |
| 140 void OnRegistrationDeleted(int64 registration_id, | 141 void OnRegistrationDeleted(int64 registration_id, |
| 141 const GURL& pattern) override { | 142 const GURL& pattern) override { |
| 142 NotificationLog log; | 143 NotificationLog log; |
| 143 log.type = REGISTRATION_DELETED; | 144 log.type = REGISTRATION_DELETED; |
| 144 log.pattern = pattern; | 145 log.pattern = pattern; |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 586 | 587 |
| 587 ASSERT_EQ(3u, notifications_.size()); | 588 ASSERT_EQ(3u, notifications_.size()); |
| 588 EXPECT_EQ(REGISTRATION_STORED, notifications_[0].type); | 589 EXPECT_EQ(REGISTRATION_STORED, notifications_[0].type); |
| 589 EXPECT_EQ(pattern, notifications_[0].pattern); | 590 EXPECT_EQ(pattern, notifications_[0].pattern); |
| 590 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); | 591 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); |
| 591 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); | 592 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); |
| 592 EXPECT_EQ(pattern, notifications_[2].pattern); | 593 EXPECT_EQ(pattern, notifications_[2].pattern); |
| 593 } | 594 } |
| 594 | 595 |
| 595 } // namespace content | 596 } // namespace content |
| OLD | NEW |