Index: content/browser/payments/payment_app_content_unittest_base.cc |
diff --git a/content/browser/payments/payment_app_content_unittest_base.cc b/content/browser/payments/payment_app_content_unittest_base.cc |
index 6d35a9aa95ba5e6d18768846b12b008e6dfda908..37294f68bfdab0aba24182671853e164a7c806f9 100644 |
--- a/content/browser/payments/payment_app_content_unittest_base.cc |
+++ b/content/browser/payments/payment_app_content_unittest_base.cc |
@@ -28,13 +28,11 @@ namespace content { |
namespace { |
void RegisterServiceWorkerCallback(bool* called, |
- int64_t* out_registration_id, |
ServiceWorkerStatusCode status, |
const std::string& status_message, |
int64_t registration_id) { |
EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
*called = true; |
- *out_registration_id = registration_id; |
} |
void UnregisterServiceWorkerCallback(bool* called, |
@@ -43,11 +41,6 @@ void UnregisterServiceWorkerCallback(bool* called, |
*called = true; |
} |
-void StopWorkerCallback(bool* called, ServiceWorkerStatusCode status) { |
- EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
- *called = true; |
-} |
- |
} // namespace |
class PaymentAppContentUnitTestBase::PaymentAppForWorkerTestHelper |
@@ -58,24 +51,21 @@ class PaymentAppContentUnitTestBase::PaymentAppForWorkerTestHelper |
last_sw_registration_id_(kInvalidServiceWorkerRegistrationId) {} |
~PaymentAppForWorkerTestHelper() override {} |
- void OnStartWorker( |
- int embedded_worker_id, |
- int64_t service_worker_version_id, |
- const GURL& scope, |
- const GURL& script_url, |
- bool pause_after_download, |
- mojom::ServiceWorkerEventDispatcherRequest request, |
- mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo instance_host, |
- mojom::ServiceWorkerProviderInfoForStartWorkerPtr provider_info) |
- override { |
+ void OnStartWorker(int embedded_worker_id, |
+ int64_t service_worker_version_id, |
+ const GURL& scope, |
+ const GURL& script_url, |
+ bool pause_after_download, |
+ mojom::ServiceWorkerEventDispatcherRequest request, |
+ mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo |
+ instance_host) override { |
ServiceWorkerVersion* version = |
context()->GetLiveVersion(service_worker_version_id); |
last_sw_registration_id_ = version->registration_id(); |
last_sw_scope_ = scope; |
EmbeddedWorkerTestHelper::OnStartWorker( |
embedded_worker_id, service_worker_version_id, scope, script_url, |
- pause_after_download, std::move(request), std::move(instance_host), |
- std::move(provider_info)); |
+ pause_after_download, std::move(request), std::move(instance_host)); |
} |
void OnPaymentRequestEvent( |
@@ -121,23 +111,9 @@ PaymentManager* PaymentAppContentUnitTestBase::CreatePaymentManager( |
const GURL& sw_script_url) { |
// Register service worker for payment manager. |
bool called = false; |
- int64_t registration_id; |
worker_helper_->context()->RegisterServiceWorker( |
scope_url, sw_script_url, nullptr, |
- base::Bind(&RegisterServiceWorkerCallback, &called, ®istration_id)); |
- base::RunLoop().RunUntilIdle(); |
- EXPECT_TRUE(called); |
- |
- // Ensure the worker used for installation has stopped. |
- called = false; |
- ServiceWorkerRegistration* registration = |
- worker_helper_->context()->GetLiveRegistration(registration_id); |
- EXPECT_TRUE(registration); |
- EXPECT_TRUE(registration->active_version()); |
- EXPECT_FALSE(registration->waiting_version()); |
- EXPECT_FALSE(registration->installing_version()); |
- registration->active_version()->StopWorker( |
- base::Bind(&StopWorkerCallback, &called)); |
+ base::Bind(&RegisterServiceWorkerCallback, &called)); |
base::RunLoop().RunUntilIdle(); |
EXPECT_TRUE(called); |