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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 EXPECT_FALSE(registration->active_version()); | 74 EXPECT_FALSE(registration->active_version()); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 class RejectInstallTestHelper : public EmbeddedWorkerTestHelper { | 78 class RejectInstallTestHelper : public EmbeddedWorkerTestHelper { |
79 public: | 79 public: |
80 explicit RejectInstallTestHelper(int mock_render_process_id) | 80 explicit RejectInstallTestHelper(int mock_render_process_id) |
81 : EmbeddedWorkerTestHelper(mock_render_process_id) {} | 81 : EmbeddedWorkerTestHelper(mock_render_process_id) {} |
82 | 82 |
83 void OnInstallEvent(int embedded_worker_id, | 83 void OnInstallEvent(int embedded_worker_id, |
84 int request_id, | 84 int request_id) override { |
85 int active_version_id) override { | |
86 SimulateSend( | 85 SimulateSend( |
87 new ServiceWorkerHostMsg_InstallEventFinished( | 86 new ServiceWorkerHostMsg_InstallEventFinished( |
88 embedded_worker_id, request_id, | 87 embedded_worker_id, request_id, |
89 blink::WebServiceWorkerEventResultRejected)); | 88 blink::WebServiceWorkerEventResultRejected)); |
90 } | 89 } |
91 }; | 90 }; |
92 | 91 |
93 class RejectActivateTestHelper : public EmbeddedWorkerTestHelper { | 92 class RejectActivateTestHelper : public EmbeddedWorkerTestHelper { |
94 public: | 93 public: |
95 explicit RejectActivateTestHelper(int mock_render_process_id) | 94 explicit RejectActivateTestHelper(int mock_render_process_id) |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 | 586 |
588 ASSERT_EQ(3u, notifications_.size()); | 587 ASSERT_EQ(3u, notifications_.size()); |
589 EXPECT_EQ(REGISTRATION_STORED, notifications_[0].type); | 588 EXPECT_EQ(REGISTRATION_STORED, notifications_[0].type); |
590 EXPECT_EQ(pattern, notifications_[0].pattern); | 589 EXPECT_EQ(pattern, notifications_[0].pattern); |
591 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); | 590 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); |
592 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); | 591 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); |
593 EXPECT_EQ(pattern, notifications_[2].pattern); | 592 EXPECT_EQ(pattern, notifications_[2].pattern); |
594 } | 593 } |
595 | 594 |
596 } // namespace content | 595 } // namespace content |
OLD | NEW |