OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 void RegistrationPendingDidGetSyncRegistration( | 71 void RegistrationPendingDidGetSyncRegistration( |
72 const std::string& tag, | 72 const std::string& tag, |
73 const base::Callback<void(bool)>& callback, | 73 const base::Callback<void(bool)>& callback, |
74 BackgroundSyncStatus error_type, | 74 BackgroundSyncStatus error_type, |
75 std::unique_ptr<ScopedVector<BackgroundSyncRegistration>> registrations) { | 75 std::unique_ptr<ScopedVector<BackgroundSyncRegistration>> registrations) { |
76 ASSERT_EQ(BACKGROUND_SYNC_STATUS_OK, error_type); | 76 ASSERT_EQ(BACKGROUND_SYNC_STATUS_OK, error_type); |
77 // Find the right registration in the list and check its status. | 77 // Find the right registration in the list and check its status. |
78 for (const BackgroundSyncRegistration* registration : *registrations) { | 78 for (const BackgroundSyncRegistration* registration : *registrations) { |
79 if (registration->options()->tag == tag) { | 79 if (registration->options()->tag == tag) { |
80 callback.Run(registration->sync_state() == | 80 callback.Run(registration->sync_state() == |
81 mojom::BackgroundSyncState::PENDING); | 81 blink::mojom::BackgroundSyncState::PENDING); |
82 return; | 82 return; |
83 } | 83 } |
84 } | 84 } |
85 ADD_FAILURE() << "Registration should exist"; | 85 ADD_FAILURE() << "Registration should exist"; |
86 } | 86 } |
87 | 87 |
88 void RegistrationPendingDidGetSWRegistration( | 88 void RegistrationPendingDidGetSWRegistration( |
89 const scoped_refptr<BackgroundSyncContext> sync_context, | 89 const scoped_refptr<BackgroundSyncContext> sync_context, |
90 const std::string& tag, | 90 const std::string& tag, |
91 const base::Callback<void(bool)>& callback, | 91 const base::Callback<void(bool)>& callback, |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 IN_PROC_BROWSER_TEST_F(BackgroundSyncBrowserTest, | 680 IN_PROC_BROWSER_TEST_F(BackgroundSyncBrowserTest, |
681 RegisterFromServiceWorkerWithoutMainFrameHost) { | 681 RegisterFromServiceWorkerWithoutMainFrameHost) { |
682 std::string script_result; | 682 std::string script_result; |
683 EXPECT_TRUE( | 683 EXPECT_TRUE( |
684 RegisterFromCrossOriginFrame(kRegisterSyncFromSWURL, &script_result)); | 684 RegisterFromCrossOriginFrame(kRegisterSyncFromSWURL, &script_result)); |
685 EXPECT_EQ(BuildExpectedResult("frame", "failed to register sync"), | 685 EXPECT_EQ(BuildExpectedResult("frame", "failed to register sync"), |
686 script_result); | 686 script_result); |
687 } | 687 } |
688 | 688 |
689 } // namespace content | 689 } // namespace content |
OLD | NEW |