From d5ae7f85db726f86d88d14a35dceefe4814cf15e Mon Sep 17 00:00:00 2001 From: Dan Elphick Date: Wed, 9 Aug 2017 09:42:17 +0000 Subject: [PATCH] Rename tag to id in BackgroundFetchRegistration Matches recent change to spec: https://github.com/WICG/background-fetch/commit/15dd317bbb2e2c7da12ebb11de547e635e59969f Bug: 752946 Change-Id: I4065564d79dd8a0d7aad5c7f49f6d87288e3b4f5 Reviewed-on: https://chromium-review.googlesource.com/603654 Reviewed-by: Avi Drissman Reviewed-by: Mike West Reviewed-by: Tsuyoshi Horo Reviewed-by: Peter Beverloo Commit-Queue: Dan Elphick Cr-Commit-Position: refs/heads/master@{#492924} --- .../background_fetch_context.cc | 12 +- .../background_fetch_context.h | 4 +- .../background_fetch_data_manager.cc | 4 +- .../background_fetch_data_manager_unittest.cc | 8 +- ...round_fetch_embedded_worker_test_helper.cc | 16 +- ...ground_fetch_embedded_worker_test_helper.h | 12 +- .../background_fetch_event_dispatcher.cc | 25 ++-- ...kground_fetch_event_dispatcher_unittest.cc | 54 +++---- .../background_fetch_registration_id.cc | 10 +- .../background_fetch_registration_id.h | 6 +- .../background_fetch_service_impl.cc | 58 ++++---- .../background_fetch_service_impl.h | 18 +-- .../background_fetch_service_unittest.cc | 139 +++++++++--------- content/browser/bad_message.h | 2 +- .../background_fetch_struct_traits.cc | 2 +- .../background_fetch_struct_traits.h | 4 +- ...background_fetch_struct_traits_unittest.cc | 4 +- .../background_fetch/background_fetch_types.h | 2 +- .../service_worker_event_dispatcher.mojom | 10 +- .../background-fetch/interfaces-expected.txt | 4 +- .../interfaces-worker.https-expected.txt | 6 +- .../wpt/background-fetch/interfaces.idl | 12 +- .../interfaces.worker-expected.txt | 4 +- .../background-fetch-click-event.https.html | 2 +- .../background-fetch-event.https.html | 2 +- .../background-fetch-fail-event.https.html | 2 +- .../background-fetch-manager-fetch.https.html | 14 +- .../background-fetch-manager-get.https.html | 20 +-- ...ackground-fetch-manager-getTags.https.html | 32 ++-- ...ground-fetch-registration-abort.https.html | 4 +- .../background-fetched-event.https.html | 2 +- .../background-fetch-click-event-worker.js | 12 +- .../background-fetch-event-worker.js | 6 +- .../background-fetch-fail-event-worker.js | 10 +- .../background-fetched-event-worker.js | 10 +- ...erface-listing-service-worker-expected.txt | 6 +- ...erface-listing-service-worker-expected.txt | 6 +- ...face-listing-dedicated-worker-expected.txt | 4 +- .../global-interface-listing-expected.txt | 4 +- ...terface-listing-shared-worker-expected.txt | 4 +- ...erface-listing-service-worker-expected.txt | 6 +- ...face-listing-dedicated-worker-expected.txt | 4 +- .../global-interface-listing-expected.txt | 4 +- ...terface-listing-shared-worker-expected.txt | 4 +- .../BackgroundFetchBridge.cpp | 24 +-- .../background_fetch/BackgroundFetchBridge.h | 28 ++-- .../background_fetch/BackgroundFetchEvent.cpp | 6 +- .../background_fetch/BackgroundFetchEvent.h | 4 +- .../background_fetch/BackgroundFetchEvent.idl | 2 +- .../BackgroundFetchEventInit.idl | 2 +- .../BackgroundFetchManager.cpp | 39 +++-- .../background_fetch/BackgroundFetchManager.h | 12 +- .../BackgroundFetchManager.idl | 6 +- .../BackgroundFetchRegistration.cpp | 16 +- .../BackgroundFetchRegistration.h | 6 +- .../BackgroundFetchRegistration.idl | 2 +- .../BackgroundFetchTypeConverters.cpp | 2 +- .../BackgroundFetchedEvent.cpp | 6 +- .../ServiceWorkerGlobalScopeProxy.cpp | 20 +-- .../background_fetch/background_fetch.mojom | 28 ++-- tools/metrics/histograms/enums.xml | 2 +- 61 files changed, 388 insertions(+), 391 deletions(-) diff --git a/content/browser/background_fetch/background_fetch_context.cc b/content/browser/background_fetch/background_fetch_context.cc index 45d3d153714fca..675bd895bd1460 100644 --- a/content/browser/background_fetch/background_fetch_context.cc +++ b/content/browser/background_fetch/background_fetch_context.cc @@ -94,7 +94,7 @@ void BackgroundFetchContext::DidCreateRegistration( // Create the BackgroundFetchRegistration the renderer process will receive, // which enables it to resolve the promise telling the developer it worked. BackgroundFetchRegistration registration; - registration.tag = registration_id.tag(); + registration.id = registration_id.id(); registration.icons = options.icons; registration.title = options.title; registration.total_download_size = options.total_download_size; @@ -104,25 +104,25 @@ void BackgroundFetchContext::DidCreateRegistration( } std::vector -BackgroundFetchContext::GetActiveTagsForServiceWorkerRegistration( +BackgroundFetchContext::GetActiveIdsForServiceWorkerRegistration( int64_t service_worker_registration_id, const url::Origin& origin) const { DCHECK_CURRENTLY_ON(BrowserThread::IO); - std::vector tags; + std::vector ids; for (const auto& pair : active_fetches_) { const BackgroundFetchRegistrationId& registration_id = pair.second->registration_id(); - // Only return the tags when the origin and SW registration id match. + // Only return the ids when the origin and SW registration id match. if (registration_id.origin() == origin && registration_id.service_worker_registration_id() == service_worker_registration_id) { - tags.push_back(pair.second->registration_id().tag()); + ids.push_back(pair.second->registration_id().id()); } } - return tags; + return ids; } BackgroundFetchJobController* BackgroundFetchContext::GetActiveFetch( diff --git a/content/browser/background_fetch/background_fetch_context.h b/content/browser/background_fetch/background_fetch_context.h index a6253403748db0..be613c46fb54c9 100644 --- a/content/browser/background_fetch/background_fetch_context.h +++ b/content/browser/background_fetch/background_fetch_context.h @@ -64,9 +64,9 @@ class CONTENT_EXPORT BackgroundFetchContext const BackgroundFetchOptions& options, blink::mojom::BackgroundFetchService::FetchCallback callback); - // Returns a vector with the tags of the active fetches for the given |origin| + // Returns a vector with the ids of the active fetches for the given |origin| // and |service_worker_registration_id|. - std::vector GetActiveTagsForServiceWorkerRegistration( + std::vector GetActiveIdsForServiceWorkerRegistration( int64_t service_worker_registration_id, const url::Origin& origin) const; diff --git a/content/browser/background_fetch/background_fetch_data_manager.cc b/content/browser/background_fetch/background_fetch_data_manager.cc index 61779b4937b421..8aaed60cd7dc04 100644 --- a/content/browser/background_fetch/background_fetch_data_manager.cc +++ b/content/browser/background_fetch/background_fetch_data_manager.cc @@ -150,7 +150,7 @@ void BackgroundFetchDataManager::CreateRegistration( DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (registrations_.find(registration_id) != registrations_.end()) { - std::move(callback).Run(blink::mojom::BackgroundFetchError::DUPLICATED_TAG); + std::move(callback).Run(blink::mojom::BackgroundFetchError::DUPLICATED_ID); return; } @@ -293,7 +293,7 @@ void BackgroundFetchDataManager::DeleteRegistration( auto iter = registrations_.find(registration_id); if (iter == registrations_.end()) { - std::move(callback).Run(blink::mojom::BackgroundFetchError::INVALID_TAG); + std::move(callback).Run(blink::mojom::BackgroundFetchError::INVALID_ID); return; } diff --git a/content/browser/background_fetch/background_fetch_data_manager_unittest.cc b/content/browser/background_fetch/background_fetch_data_manager_unittest.cc index 9a9e71a83a27af..f531f090606303 100644 --- a/content/browser/background_fetch/background_fetch_data_manager_unittest.cc +++ b/content/browser/background_fetch/background_fetch_data_manager_unittest.cc @@ -18,7 +18,7 @@ namespace content { namespace { -const char kExampleTag[] = "my-example-tag"; +const char kExampleId[] = "my-example-id"; } // namespace @@ -87,7 +87,7 @@ TEST_F(BackgroundFetchDataManagerTest, NoDuplicateRegistrations) { // registration that's already known to the system. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); std::vector requests; BackgroundFetchOptions options; @@ -96,7 +96,7 @@ TEST_F(BackgroundFetchDataManagerTest, NoDuplicateRegistrations) { // Deleting the not-yet-created registration should fail. ASSERT_NO_FATAL_FAILURE(DeleteRegistration(registration_id, &error)); - EXPECT_EQ(error, blink::mojom::BackgroundFetchError::INVALID_TAG); + EXPECT_EQ(error, blink::mojom::BackgroundFetchError::INVALID_ID); // Creating the initial registration should succeed. ASSERT_NO_FATAL_FAILURE( @@ -106,7 +106,7 @@ TEST_F(BackgroundFetchDataManagerTest, NoDuplicateRegistrations) { // Attempting to create it again should yield an error. ASSERT_NO_FATAL_FAILURE( CreateRegistration(registration_id, requests, options, &error)); - EXPECT_EQ(error, blink::mojom::BackgroundFetchError::DUPLICATED_TAG); + EXPECT_EQ(error, blink::mojom::BackgroundFetchError::DUPLICATED_ID); // Deleting the registration should succeed. ASSERT_NO_FATAL_FAILURE(DeleteRegistration(registration_id, &error)); diff --git a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc index e5d4b165cd07aa..7542a7544a1a29 100644 --- a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc +++ b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc @@ -20,10 +20,10 @@ BackgroundFetchEmbeddedWorkerTestHelper:: ~BackgroundFetchEmbeddedWorkerTestHelper() = default; void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchAbortEvent( - const std::string& tag, + const std::string& id, mojom::ServiceWorkerEventDispatcher:: DispatchBackgroundFetchAbortEventCallback callback) { - last_tag_ = tag; + last_id_ = id; if (fail_abort_event_) { std::move(callback).Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED, @@ -37,11 +37,11 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchAbortEvent( } void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchClickEvent( - const std::string& tag, + const std::string& id, mojom::BackgroundFetchState state, mojom::ServiceWorkerEventDispatcher:: DispatchBackgroundFetchClickEventCallback callback) { - last_tag_ = tag; + last_id_ = id; last_state_ = state; if (fail_click_event_) { @@ -56,11 +56,11 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchClickEvent( } void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchFailEvent( - const std::string& tag, + const std::string& id, const std::vector& fetches, mojom::ServiceWorkerEventDispatcher:: DispatchBackgroundFetchFailEventCallback callback) { - last_tag_ = tag; + last_id_ = id; last_fetches_ = fetches; if (fail_fetch_fail_event_) { @@ -75,11 +75,11 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchFailEvent( } void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchedEvent( - const std::string& tag, + const std::string& id, const std::vector& fetches, mojom::ServiceWorkerEventDispatcher::DispatchBackgroundFetchedEventCallback callback) { - last_tag_ = tag; + last_id_ = id; last_fetches_ = fetches; if (fail_fetched_event_) { diff --git a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h index 07abed7164c4ee..4192f4b4cdb95d 100644 --- a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h +++ b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h @@ -50,7 +50,7 @@ class BackgroundFetchEmbeddedWorkerTestHelper fetched_event_closure_ = closure; } - const base::Optional& last_tag() const { return last_tag_; } + const base::Optional& last_id() const { return last_id_; } const base::Optional& last_state() const { return last_state_; } @@ -62,21 +62,21 @@ class BackgroundFetchEmbeddedWorkerTestHelper protected: // EmbeddedWorkerTestHelper overrides: void OnBackgroundFetchAbortEvent( - const std::string& tag, + const std::string& id, mojom::ServiceWorkerEventDispatcher:: DispatchBackgroundFetchAbortEventCallback callback) override; void OnBackgroundFetchClickEvent( - const std::string& tag, + const std::string& id, mojom::BackgroundFetchState state, mojom::ServiceWorkerEventDispatcher:: DispatchBackgroundFetchClickEventCallback callback) override; void OnBackgroundFetchFailEvent( - const std::string& tag, + const std::string& id, const std::vector& fetches, mojom::ServiceWorkerEventDispatcher:: DispatchBackgroundFetchFailEventCallback callback) override; void OnBackgroundFetchedEvent( - const std::string& tag, + const std::string& id, const std::vector& fetches, mojom::ServiceWorkerEventDispatcher:: DispatchBackgroundFetchedEventCallback callback) override; @@ -92,7 +92,7 @@ class BackgroundFetchEmbeddedWorkerTestHelper base::Closure fetch_fail_event_closure_; base::Closure fetched_event_closure_; - base::Optional last_tag_; + base::Optional last_id_; base::Optional last_state_; base::Optional> last_fetches_; diff --git a/content/browser/background_fetch/background_fetch_event_dispatcher.cc b/content/browser/background_fetch/background_fetch_event_dispatcher.cc index 1de7fef1b8f9fe..3dafa3d72ffd70 100644 --- a/content/browser/background_fetch/background_fetch_event_dispatcher.cc +++ b/content/browser/background_fetch/background_fetch_event_dispatcher.cc @@ -83,16 +83,16 @@ void BackgroundFetchEventDispatcher::DispatchBackgroundFetchAbortEvent( std::move(finished_closure), base::Bind( &BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchAbortEvent, - registration_id.tag())); + registration_id.id())); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchAbortEvent( - const std::string& tag, + const std::string& id, scoped_refptr service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->event_dispatcher()->DispatchBackgroundFetchAbortEvent( - tag, service_worker_version->CreateSimpleEventCallback(request_id)); + id, service_worker_version->CreateSimpleEventCallback(request_id)); } void BackgroundFetchEventDispatcher::DispatchBackgroundFetchClickEvent( @@ -105,18 +105,17 @@ void BackgroundFetchEventDispatcher::DispatchBackgroundFetchClickEvent( std::move(finished_closure), base::Bind( &BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchClickEvent, - registration_id.tag(), state)); + registration_id.id(), state)); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchClickEvent( - const std::string& tag, + const std::string& id, mojom::BackgroundFetchState state, scoped_refptr service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->event_dispatcher()->DispatchBackgroundFetchClickEvent( - tag, state, - service_worker_version->CreateSimpleEventCallback(request_id)); + id, state, service_worker_version->CreateSimpleEventCallback(request_id)); } void BackgroundFetchEventDispatcher::DispatchBackgroundFetchFailEvent( @@ -129,17 +128,17 @@ void BackgroundFetchEventDispatcher::DispatchBackgroundFetchFailEvent( std::move(finished_closure), base::Bind( &BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchFailEvent, - registration_id.tag(), fetches)); + registration_id.id(), fetches)); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchFailEvent( - const std::string& tag, + const std::string& id, const std::vector& fetches, scoped_refptr service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->event_dispatcher()->DispatchBackgroundFetchFailEvent( - tag, fetches, + id, fetches, service_worker_version->CreateSimpleEventCallback(request_id)); } @@ -153,17 +152,17 @@ void BackgroundFetchEventDispatcher::DispatchBackgroundFetchedEvent( std::move(finished_closure), base::Bind( &BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchedEvent, - registration_id.tag(), fetches)); + registration_id.id(), fetches)); } void BackgroundFetchEventDispatcher::DoDispatchBackgroundFetchedEvent( - const std::string& tag, + const std::string& id, const std::vector& fetches, scoped_refptr service_worker_version, int request_id) { DCHECK(service_worker_version); service_worker_version->event_dispatcher()->DispatchBackgroundFetchedEvent( - tag, fetches, + id, fetches, service_worker_version->CreateSimpleEventCallback(request_id)); } diff --git a/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc b/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc index 222dd93a1fdcd1..b7c2128c7a8994 100644 --- a/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc +++ b/content/browser/background_fetch/background_fetch_event_dispatcher_unittest.cc @@ -19,8 +19,8 @@ namespace content { namespace { -const char kExampleTag[] = "my-tag"; -const char kExampleTag2[] = "my-second-tag"; +const char kExampleId[] = "my-id"; +const char kExampleId2[] = "my-second-id"; class BackgroundFetchEventDispatcherTest : public BackgroundFetchTestBase { public: @@ -37,7 +37,7 @@ class BackgroundFetchEventDispatcherTest : public BackgroundFetchTestBase { TEST_F(BackgroundFetchEventDispatcherTest, DispatchInvalidRegistration) { BackgroundFetchRegistrationId invalid_registration_id( - 9042 /* random invalid id */, origin(), kExampleTag); + 9042 /* random invalid id */, origin(), kExampleId); base::RunLoop run_loop; event_dispatcher_.DispatchBackgroundFetchAbortEvent(invalid_registration_id, @@ -55,7 +55,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchInvalidRegistration) { TEST_F(BackgroundFetchEventDispatcherTest, DispatchAbortEvent) { BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); { base::RunLoop run_loop; @@ -65,8 +65,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchAbortEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId, embedded_worker_test_helper()->last_id().value()); histogram_tester_.ExpectUniqueSample( "BackgroundFetch.EventDispatchResult.AbortEvent", @@ -76,7 +76,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchAbortEvent) { BackgroundFetchRegistrationId second_registration_id( registration_id.service_worker_registration_id(), - registration_id.origin(), kExampleTag2); + registration_id.origin(), kExampleId2); { base::RunLoop run_loop; @@ -86,8 +86,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchAbortEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag2, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId2, embedded_worker_test_helper()->last_id().value()); histogram_tester_.ExpectBucketCount( "BackgroundFetch.EventDispatchResult.AbortEvent", @@ -102,7 +102,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchAbortEvent) { TEST_F(BackgroundFetchEventDispatcherTest, DispatchClickEvent) { BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); { base::RunLoop run_loop; @@ -113,8 +113,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchClickEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_state().has_value()); EXPECT_EQ(mojom::BackgroundFetchState::PENDING, @@ -128,7 +128,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchClickEvent) { BackgroundFetchRegistrationId second_registration_id( registration_id.service_worker_registration_id(), - registration_id.origin(), kExampleTag2); + registration_id.origin(), kExampleId2); { base::RunLoop run_loop; @@ -139,8 +139,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchClickEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag2, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId2, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_state().has_value()); EXPECT_EQ(mojom::BackgroundFetchState::SUCCEEDED, @@ -159,7 +159,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchClickEvent) { TEST_F(BackgroundFetchEventDispatcherTest, DispatchFailEvent) { BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); std::vector fetches; fetches.push_back(BackgroundFetchSettledFetch()); @@ -172,8 +172,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchFailEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_fetches().has_value()); EXPECT_EQ(fetches.size(), @@ -189,7 +189,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchFailEvent) { BackgroundFetchRegistrationId second_registration_id( registration_id.service_worker_registration_id(), - registration_id.origin(), kExampleTag2); + registration_id.origin(), kExampleId2); { base::RunLoop run_loop; @@ -199,8 +199,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchFailEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag2, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId2, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_fetches().has_value()); EXPECT_EQ(fetches.size(), @@ -219,7 +219,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchFailEvent) { TEST_F(BackgroundFetchEventDispatcherTest, DispatchFetchedEvent) { BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); std::vector fetches; fetches.push_back(BackgroundFetchSettledFetch()); @@ -232,8 +232,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchFetchedEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_fetches().has_value()); EXPECT_EQ(fetches.size(), @@ -249,7 +249,7 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchFetchedEvent) { BackgroundFetchRegistrationId second_registration_id( registration_id.service_worker_registration_id(), - registration_id.origin(), kExampleTag2); + registration_id.origin(), kExampleId2); { base::RunLoop run_loop; @@ -259,8 +259,8 @@ TEST_F(BackgroundFetchEventDispatcherTest, DispatchFetchedEvent) { run_loop.Run(); } - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag2, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId2, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_fetches().has_value()); EXPECT_EQ(fetches.size(), diff --git a/content/browser/background_fetch/background_fetch_registration_id.cc b/content/browser/background_fetch/background_fetch_registration_id.cc index db7653bbb1bcc0..02d5a6ea054f5d 100644 --- a/content/browser/background_fetch/background_fetch_registration_id.cc +++ b/content/browser/background_fetch/background_fetch_registration_id.cc @@ -16,10 +16,10 @@ BackgroundFetchRegistrationId::BackgroundFetchRegistrationId() BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag) + const std::string& id) : service_worker_registration_id_(service_worker_registration_id), origin_(origin), - tag_(tag) {} + id_(id) {} BackgroundFetchRegistrationId::BackgroundFetchRegistrationId( const BackgroundFetchRegistrationId& other) = default; @@ -36,7 +36,7 @@ bool BackgroundFetchRegistrationId::operator==( const BackgroundFetchRegistrationId& other) const { return other.service_worker_registration_id_ == service_worker_registration_id_ && - other.origin_ == origin_ && other.tag_ == tag_; + other.origin_ == origin_ && other.id_ == id_; } bool BackgroundFetchRegistrationId::operator!=( @@ -46,9 +46,9 @@ bool BackgroundFetchRegistrationId::operator!=( bool BackgroundFetchRegistrationId::operator<( const BackgroundFetchRegistrationId& other) const { - return std::tie(service_worker_registration_id_, origin_, tag_) < + return std::tie(service_worker_registration_id_, origin_, id_) < std::tie(other.service_worker_registration_id_, other.origin_, - other.tag_); + other.id_); } bool BackgroundFetchRegistrationId::is_null() const { diff --git a/content/browser/background_fetch/background_fetch_registration_id.h b/content/browser/background_fetch/background_fetch_registration_id.h index 32fb5da8145ae9..7552f204b97a53 100644 --- a/content/browser/background_fetch/background_fetch_registration_id.h +++ b/content/browser/background_fetch/background_fetch_registration_id.h @@ -20,7 +20,7 @@ class CONTENT_EXPORT BackgroundFetchRegistrationId { BackgroundFetchRegistrationId(); BackgroundFetchRegistrationId(int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag); + const std::string& id); BackgroundFetchRegistrationId(const BackgroundFetchRegistrationId& other); BackgroundFetchRegistrationId(BackgroundFetchRegistrationId&& other); ~BackgroundFetchRegistrationId(); @@ -43,12 +43,12 @@ class CONTENT_EXPORT BackgroundFetchRegistrationId { return service_worker_registration_id_; } const url::Origin& origin() const { return origin_; } - const std::string& tag() const { return tag_; } + const std::string& id() const { return id_; } private: int64_t service_worker_registration_id_; url::Origin origin_; - std::string tag_; + std::string id_; }; } // namespace content diff --git a/content/browser/background_fetch/background_fetch_service_impl.cc b/content/browser/background_fetch/background_fetch_service_impl.cc index e3c53375424bfd..a65b82d9e442c0 100644 --- a/content/browser/background_fetch/background_fetch_service_impl.cc +++ b/content/browser/background_fetch/background_fetch_service_impl.cc @@ -22,8 +22,8 @@ namespace content { namespace { -// Maximum length of a developer-provided tag for a Background Fetch. -constexpr size_t kMaxTagLength = 1024 * 1024; +// Maximum length of a developer-provided id for a Background Fetch. +constexpr size_t kMaxIdLength = 1024 * 1024; // Maximum length of a developer-provided title for a Background Fetch. constexpr size_t kMaxTitleLength = 1024 * 1024; @@ -57,12 +57,12 @@ BackgroundFetchServiceImpl::~BackgroundFetchServiceImpl() { void BackgroundFetchServiceImpl::Fetch( int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, const std::vector& requests, const BackgroundFetchOptions& options, FetchCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!ValidateTag(tag)) { + if (!ValidateId(id)) { std::move(callback).Run( blink::mojom::BackgroundFetchError::INVALID_ARGUMENT, base::nullopt /* registration */); @@ -77,7 +77,7 @@ void BackgroundFetchServiceImpl::Fetch( } BackgroundFetchRegistrationId registration_id(service_worker_registration_id, - origin, tag); + origin, id); background_fetch_context_->StartFetch(registration_id, requests, options, std::move(callback)); @@ -86,11 +86,11 @@ void BackgroundFetchServiceImpl::Fetch( void BackgroundFetchServiceImpl::UpdateUI( int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, const std::string& title, UpdateUICallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!ValidateTag(tag) || !ValidateTitle(title)) { + if (!ValidateId(id) || !ValidateTitle(title)) { std::move(callback).Run( blink::mojom::BackgroundFetchError::INVALID_ARGUMENT); return; @@ -98,22 +98,22 @@ void BackgroundFetchServiceImpl::UpdateUI( BackgroundFetchJobController* controller = background_fetch_context_->GetActiveFetch(BackgroundFetchRegistrationId( - service_worker_registration_id, origin, tag)); + service_worker_registration_id, origin, id)); if (controller) controller->UpdateUI(title); - std::move(callback).Run( - controller ? blink::mojom::BackgroundFetchError::NONE - : blink::mojom::BackgroundFetchError::INVALID_TAG); + std::move(callback).Run(controller + ? blink::mojom::BackgroundFetchError::NONE + : blink::mojom::BackgroundFetchError::INVALID_ID); } void BackgroundFetchServiceImpl::Abort(int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, AbortCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!ValidateTag(tag)) { + if (!ValidateId(id)) { std::move(callback).Run( blink::mojom::BackgroundFetchError::INVALID_ARGUMENT); return; @@ -121,23 +121,23 @@ void BackgroundFetchServiceImpl::Abort(int64_t service_worker_registration_id, BackgroundFetchJobController* controller = background_fetch_context_->GetActiveFetch(BackgroundFetchRegistrationId( - service_worker_registration_id, origin, tag)); + service_worker_registration_id, origin, id)); if (controller) controller->Abort(); - std::move(callback).Run( - controller ? blink::mojom::BackgroundFetchError::NONE - : blink::mojom::BackgroundFetchError::INVALID_TAG); + std::move(callback).Run(controller + ? blink::mojom::BackgroundFetchError::NONE + : blink::mojom::BackgroundFetchError::INVALID_ID); } void BackgroundFetchServiceImpl::GetRegistration( int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, GetRegistrationCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!ValidateTag(tag)) { + if (!ValidateId(id)) { std::move(callback).Run( blink::mojom::BackgroundFetchError::INVALID_ARGUMENT, base::nullopt /* registration */); @@ -146,10 +146,10 @@ void BackgroundFetchServiceImpl::GetRegistration( BackgroundFetchJobController* controller = background_fetch_context_->GetActiveFetch(BackgroundFetchRegistrationId( - service_worker_registration_id, origin, tag)); + service_worker_registration_id, origin, id)); if (!controller) { - std::move(callback).Run(blink::mojom::BackgroundFetchError::INVALID_TAG, + std::move(callback).Run(blink::mojom::BackgroundFetchError::INVALID_ID, base::nullopt /* registration */); return; } @@ -157,7 +157,7 @@ void BackgroundFetchServiceImpl::GetRegistration( // Compile the BackgroundFetchRegistration object that will be given to the // developer, representing the data associated with the |controller|. BackgroundFetchRegistration registration; - registration.tag = controller->registration_id().tag(); + registration.id = controller->registration_id().id(); registration.icons = controller->options().icons; registration.title = controller->options().title; registration.total_download_size = controller->options().total_download_size; @@ -166,20 +166,20 @@ void BackgroundFetchServiceImpl::GetRegistration( registration); } -void BackgroundFetchServiceImpl::GetTags(int64_t service_worker_registration_id, - const url::Origin& origin, - GetTagsCallback callback) { +void BackgroundFetchServiceImpl::GetIds(int64_t service_worker_registration_id, + const url::Origin& origin, + GetIdsCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); std::move(callback).Run( blink::mojom::BackgroundFetchError::NONE, - background_fetch_context_->GetActiveTagsForServiceWorkerRegistration( + background_fetch_context_->GetActiveIdsForServiceWorkerRegistration( service_worker_registration_id, origin)); } -bool BackgroundFetchServiceImpl::ValidateTag(const std::string& tag) { - if (tag.empty() || tag.size() > kMaxTagLength) { +bool BackgroundFetchServiceImpl::ValidateId(const std::string& id) { + if (id.empty() || id.size() > kMaxIdLength) { bad_message::ReceivedBadMessage(render_process_id_, - bad_message::BFSI_INVALID_TAG); + bad_message::BFSI_INVALID_ID); return false; } diff --git a/content/browser/background_fetch/background_fetch_service_impl.h b/content/browser/background_fetch/background_fetch_service_impl.h index 2fcf66a2672751..b675c504a08abb 100644 --- a/content/browser/background_fetch/background_fetch_service_impl.h +++ b/content/browser/background_fetch/background_fetch_service_impl.h @@ -41,31 +41,31 @@ class CONTENT_EXPORT BackgroundFetchServiceImpl // blink::mojom::BackgroundFetchService implementation. void Fetch(int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, const std::vector& requests, const BackgroundFetchOptions& options, FetchCallback callback) override; void UpdateUI(int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, const std::string& title, UpdateUICallback callback) override; void Abort(int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, AbortCallback callback) override; void GetRegistration(int64_t service_worker_registration_id, const url::Origin& origin, - const std::string& tag, + const std::string& id, GetRegistrationCallback callback) override; - void GetTags(int64_t service_worker_registration_id, - const url::Origin& origin, - GetTagsCallback callback) override; + void GetIds(int64_t service_worker_registration_id, + const url::Origin& origin, + GetIdsCallback callback) override; private: - // Validates and returns whether the |tag| contains a valid value. The + // Validates and returns whether the |id| contains a valid value. The // renderer will be flagged for having send a bad message if it isn't. - bool ValidateTag(const std::string& tag) WARN_UNUSED_RESULT; + bool ValidateId(const std::string& id) WARN_UNUSED_RESULT; // Validates and returns whether |requests| contains at least a valid request. // The renderer will be flagged for having send a bad message if it isn't. diff --git a/content/browser/background_fetch/background_fetch_service_unittest.cc b/content/browser/background_fetch/background_fetch_service_unittest.cc index 60a1507fce0403..cee2688bebc44a 100644 --- a/content/browser/background_fetch/background_fetch_service_unittest.cc +++ b/content/browser/background_fetch/background_fetch_service_unittest.cc @@ -22,8 +22,8 @@ namespace content { namespace { -const char kExampleTag[] = "my-background-fetch"; -const char kAlternativeTag[] = "my-alternative-fetch"; +const char kExampleId[] = "my-background-fetch"; +const char kAlternativeId[] = "my-alternative-fetch"; IconDefinition CreateIcon(std::string src, std::string sizes, @@ -53,7 +53,7 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { base::RunLoop run_loop; service_->Fetch(registration_id.service_worker_registration_id(), - registration_id.origin(), registration_id.tag(), requests, + registration_id.origin(), registration_id.id(), requests, options, base::Bind(&BackgroundFetchServiceTest::DidGetRegistration, base::Unretained(this), run_loop.QuitClosure(), @@ -74,7 +74,7 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { base::RunLoop run_loop; service_->Abort( registration_id.service_worker_registration_id(), - registration_id.origin(), registration_id.tag(), + registration_id.origin(), registration_id.id(), base::Bind(&BackgroundFetchServiceTest::DidAbort, base::Unretained(this), run_loop.QuitClosure(), out_error)); @@ -92,7 +92,7 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { base::RunLoop run_loop; service_->GetRegistration( registration_id.service_worker_registration_id(), - registration_id.origin(), registration_id.tag(), + registration_id.origin(), registration_id.id(), base::Bind(&BackgroundFetchServiceTest::DidGetRegistration, base::Unretained(this), run_loop.QuitClosure(), out_error, out_registration)); @@ -100,19 +100,19 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { run_loop.Run(); } - // Synchronous wrapper for BackgroundFetchServiceImpl::GetTags(). - void GetTags(const BackgroundFetchRegistrationId& registration_id, - blink::mojom::BackgroundFetchError* out_error, - std::vector* out_tags) { + // Synchronous wrapper for BackgroundFetchServiceImpl::GetIds(). + void GetIds(const BackgroundFetchRegistrationId& registration_id, + blink::mojom::BackgroundFetchError* out_error, + std::vector* out_ids) { DCHECK(out_error); - DCHECK(out_tags); + DCHECK(out_ids); base::RunLoop run_loop; - service_->GetTags(registration_id.service_worker_registration_id(), - registration_id.origin(), - base::Bind(&BackgroundFetchServiceTest::DidGetTags, - base::Unretained(this), run_loop.QuitClosure(), - out_error, out_tags)); + service_->GetIds(registration_id.service_worker_registration_id(), + registration_id.origin(), + base::Bind(&BackgroundFetchServiceTest::DidGetIds, + base::Unretained(this), run_loop.QuitClosure(), + out_error, out_ids)); run_loop.Run(); } @@ -171,13 +171,13 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase { quit_closure.Run(); } - void DidGetTags(base::Closure quit_closure, - blink::mojom::BackgroundFetchError* out_error, - std::vector* out_tags, - blink::mojom::BackgroundFetchError error, - const std::vector& tags) { + void DidGetIds(base::Closure quit_closure, + blink::mojom::BackgroundFetchError* out_error, + std::vector* out_ids, + blink::mojom::BackgroundFetchError error, + const std::vector& ids) { *out_error = error; - *out_tags = tags; + *out_ids = ids; quit_closure.Run(); } @@ -194,10 +194,10 @@ TEST_F(BackgroundFetchServiceTest, FetchInvalidArguments) { BackgroundFetchOptions options; - // The `tag` must be a non-empty string. + // The `id` must be a non-empty string. { BackgroundFetchRegistrationId registration_id( - 42 /* service_worker_registration_id */, origin(), "" /* tag */); + 42 /* service_worker_registration_id */, origin(), "" /* id */); std::vector requests; requests.emplace_back(); // empty, but valid @@ -213,7 +213,7 @@ TEST_F(BackgroundFetchServiceTest, FetchInvalidArguments) { // At least a single ServiceWorkerFetchRequest must be given. { BackgroundFetchRegistrationId registration_id( - 42 /* service_worker_registration_id */, origin(), kExampleTag); + 42 /* service_worker_registration_id */, origin(), kExampleId); std::vector requests; // |requests| has deliberately been left empty. @@ -230,10 +230,10 @@ TEST_F(BackgroundFetchServiceTest, FetchInvalidArguments) { TEST_F(BackgroundFetchServiceTest, FetchRegistrationProperties) { // This test starts a new Background Fetch and verifies that the returned // BackgroundFetchRegistration object matches the given options. Then gets - // the active Background Fetch with the same tag, and verifies it again. + // the active Background Fetch with the same id, and verifies it again. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); std::vector requests; requests.emplace_back(); // empty, but valid @@ -252,7 +252,7 @@ TEST_F(BackgroundFetchServiceTest, FetchRegistrationProperties) { ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE); // The |registration| should reflect the options given in |options|. - EXPECT_EQ(registration.tag, kExampleTag); + EXPECT_EQ(registration.id, kExampleId); ASSERT_EQ(registration.icons.size(), options.icons.size()); for (size_t i = 0; i < registration.icons.size(); ++i) { @@ -272,7 +272,7 @@ TEST_F(BackgroundFetchServiceTest, FetchRegistrationProperties) { ASSERT_EQ(second_error, blink::mojom::BackgroundFetchError::NONE); // The |second_registration| should reflect the options given in |options|. - EXPECT_EQ(second_registration.tag, kExampleTag); + EXPECT_EQ(second_registration.id, kExampleId); ASSERT_EQ(second_registration.icons.size(), options.icons.size()); for (size_t i = 0; i < second_registration.icons.size(); ++i) { @@ -289,10 +289,10 @@ TEST_F(BackgroundFetchServiceTest, FetchRegistrationProperties) { TEST_F(BackgroundFetchServiceTest, FetchDuplicatedRegistrationFailure) { // This tests starts a new Background Fetch, verifies that a registration was // successfully created, and then tries to start a second fetch for the same - // registration. This should fail with a DUPLICATED_TAG error. + // registration. This should fail with a DUPLICATED_ID error. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); std::vector requests; requests.emplace_back(); // empty, but valid @@ -313,7 +313,7 @@ TEST_F(BackgroundFetchServiceTest, FetchDuplicatedRegistrationFailure) { // Create the second registration with the same data. This must fail. ASSERT_NO_FATAL_FAILURE(Fetch(registration_id, requests, options, &second_error, &second_registration)); - ASSERT_EQ(second_error, blink::mojom::BackgroundFetchError::DUPLICATED_TAG); + ASSERT_EQ(second_error, blink::mojom::BackgroundFetchError::DUPLICATED_ID); } TEST_F(BackgroundFetchServiceTest, FetchSuccessEventDispatch) { @@ -322,7 +322,7 @@ TEST_F(BackgroundFetchServiceTest, FetchSuccessEventDispatch) { // `backgroundfetched` event will be dispatched with the expected contents. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); // base::RunLoop that we'll run until the event has been dispatched. If this // test times out, it means that the event could not be dispatched. @@ -377,8 +377,8 @@ TEST_F(BackgroundFetchServiceTest, FetchSuccessEventDispatch) { // Spin the |event_dispatched_loop| to wait for the dispatched event. event_dispatched_loop.Run(); - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_fetches().has_value()); @@ -433,7 +433,7 @@ TEST_F(BackgroundFetchServiceTest, FetchFailEventDispatch) { // has a non-OK status code, or the response cannot be accessed due to CORS. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); // base::RunLoop that we'll run until the event has been dispatched. If this // test times out, it means that the event could not be dispatched. @@ -474,8 +474,8 @@ TEST_F(BackgroundFetchServiceTest, FetchFailEventDispatch) { // Spin the |event_dispatched_loop| to wait for the dispatched event. event_dispatched_loop.Run(); - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId, embedded_worker_test_helper()->last_id().value()); ASSERT_TRUE(embedded_worker_test_helper()->last_fetches().has_value()); @@ -517,10 +517,10 @@ TEST_F(BackgroundFetchServiceTest, FetchFailEventDispatch) { TEST_F(BackgroundFetchServiceTest, Abort) { // This test starts a new Background Fetch, completes the registration, and // then aborts the Background Fetch mid-process. Tests all of StartFetch(), - // GetActiveFetches() and GetActiveTagsForServiceWorkerRegistration(). + // GetActiveFetches() and GetActiveIdsForServiceWorkerRegistration(). BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); std::vector requests; requests.emplace_back(); // empty, but valid @@ -550,7 +550,7 @@ TEST_F(BackgroundFetchServiceTest, Abort) { // Now try to get the created registration, which is expected to fail. ASSERT_NO_FATAL_FAILURE( GetRegistration(registration_id, &second_error, &second_registration)); - ASSERT_EQ(second_error, blink::mojom::BackgroundFetchError::INVALID_TAG); + ASSERT_EQ(second_error, blink::mojom::BackgroundFetchError::INVALID_ID); } TEST_F(BackgroundFetchServiceTest, AbortInvalidArguments) { @@ -558,7 +558,7 @@ TEST_F(BackgroundFetchServiceTest, AbortInvalidArguments) { // return INVALID_ARGUMENT when invalid data is send over the Mojo channel. BackgroundFetchRegistrationId registration_id( - 42 /* service_worker_registration_id */, origin(), "" /* tag */); + 42 /* service_worker_registration_id */, origin(), "" /* id */); blink::mojom::BackgroundFetchError error; @@ -566,19 +566,19 @@ TEST_F(BackgroundFetchServiceTest, AbortInvalidArguments) { ASSERT_EQ(error, blink::mojom::BackgroundFetchError::INVALID_ARGUMENT); } -TEST_F(BackgroundFetchServiceTest, AbortInvalidTag) { +TEST_F(BackgroundFetchServiceTest, AbortInvalidId) { // This test verifies that aborting a Background Fetch registration with a - // tag that does not correspond to an active fetch kindly tells us so. + // id that does not correspond to an active fetch kindly tells us so. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); // Deliberate do *not* create a fetch for the |registration_id|. blink::mojom::BackgroundFetchError error; ASSERT_NO_FATAL_FAILURE(Abort(registration_id, &error)); - ASSERT_EQ(error, blink::mojom::BackgroundFetchError::INVALID_TAG); + ASSERT_EQ(error, blink::mojom::BackgroundFetchError::INVALID_ID); } TEST_F(BackgroundFetchServiceTest, AbortEventDispatch) { @@ -586,7 +586,7 @@ TEST_F(BackgroundFetchServiceTest, AbortEventDispatch) { // Fetch registration has been aborted by either the user or developer. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); // base::RunLoop that we'll run until the event has been dispatched. If this // test times out, it means that the event could not be dispatched. @@ -627,34 +627,34 @@ TEST_F(BackgroundFetchServiceTest, AbortEventDispatch) { event_dispatched_loop.Run(); - ASSERT_TRUE(embedded_worker_test_helper()->last_tag().has_value()); - EXPECT_EQ(kExampleTag, embedded_worker_test_helper()->last_tag().value()); + ASSERT_TRUE(embedded_worker_test_helper()->last_id().has_value()); + EXPECT_EQ(kExampleId, embedded_worker_test_helper()->last_id().value()); } -TEST_F(BackgroundFetchServiceTest, GetTags) { - // This test verifies that the list of active tags can be retrieved from the +TEST_F(BackgroundFetchServiceTest, GetIds) { + // This test verifies that the list of active ids can be retrieved from the // service for a given Service Worker, as extracted from a registration. BackgroundFetchRegistrationId registration_id; - ASSERT_TRUE(CreateRegistrationId(kExampleTag, ®istration_id)); + ASSERT_TRUE(CreateRegistrationId(kExampleId, ®istration_id)); BackgroundFetchRegistrationId second_registration_id; - ASSERT_TRUE(CreateRegistrationId(kAlternativeTag, &second_registration_id)); + ASSERT_TRUE(CreateRegistrationId(kAlternativeId, &second_registration_id)); std::vector requests; requests.emplace_back(); // empty, but valid BackgroundFetchOptions options; - // Verify that there are no active tags yet. + // Verify that there are no active ids yet. { blink::mojom::BackgroundFetchError error; - std::vector tags; + std::vector ids; - ASSERT_NO_FATAL_FAILURE(GetTags(registration_id, &error, &tags)); + ASSERT_NO_FATAL_FAILURE(GetIds(registration_id, &error, &ids)); ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE); - ASSERT_EQ(tags.size(), 0u); + ASSERT_EQ(ids.size(), 0u); } // Start the Background Fetch for the |registration_id|. @@ -670,13 +670,13 @@ TEST_F(BackgroundFetchServiceTest, GetTags) { // Verify that there is a single active fetch (the one we just started). { blink::mojom::BackgroundFetchError error; - std::vector tags; + std::vector ids; - ASSERT_NO_FATAL_FAILURE(GetTags(registration_id, &error, &tags)); + ASSERT_NO_FATAL_FAILURE(GetIds(registration_id, &error, &ids)); ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE); - ASSERT_EQ(tags.size(), 1u); - EXPECT_EQ(tags[0], kExampleTag); + ASSERT_EQ(ids.size(), 1u); + EXPECT_EQ(ids[0], kExampleId); } // Start the Background Fetch for the |second_registration_id|. @@ -692,21 +692,20 @@ TEST_F(BackgroundFetchServiceTest, GetTags) { // Verify that there are two active fetches. { blink::mojom::BackgroundFetchError error; - std::vector tags; + std::vector ids; - ASSERT_NO_FATAL_FAILURE(GetTags(registration_id, &error, &tags)); + ASSERT_NO_FATAL_FAILURE(GetIds(registration_id, &error, &ids)); ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE); - ASSERT_EQ(tags.size(), 2u); + ASSERT_EQ(ids.size(), 2u); - // We make no guarantees about ordering of the tags. - const bool has_example_tag = - tags[0] == kExampleTag || tags[1] == kExampleTag; - const bool has_alternative_tag = - tags[0] == kAlternativeTag || tags[1] == kAlternativeTag; + // We make no guarantees about ordering of the ids. + const bool has_example_id = ids[0] == kExampleId || ids[1] == kExampleId; + const bool has_alternative_id = + ids[0] == kAlternativeId || ids[1] == kAlternativeId; - EXPECT_TRUE(has_example_tag); - EXPECT_TRUE(has_alternative_tag); + EXPECT_TRUE(has_example_id); + EXPECT_TRUE(has_alternative_id); } } diff --git a/content/browser/bad_message.h b/content/browser/bad_message.h index 7b5e1d2e19d05b..106f3cca95a00b 100644 --- a/content/browser/bad_message.h +++ b/content/browser/bad_message.h @@ -185,7 +185,7 @@ enum BadMessageReason { BDH_INVALID_DESCRIPTOR_ID = 161, RWH_INVALID_BEGIN_FRAME_ACK_DID_NOT_SWAP = 162, RWH_INVALID_BEGIN_FRAME_ACK_COMPOSITOR_FRAME = 163, - BFSI_INVALID_TAG = 164, + BFSI_INVALID_ID = 164, BFSI_INVALID_REQUESTS = 165, BFSI_INVALID_TITLE = 166, RWH_INVALID_FRAME_TOKEN = 167, diff --git a/content/common/background_fetch/background_fetch_struct_traits.cc b/content/common/background_fetch/background_fetch_struct_traits.cc index c0f5f30e602932..1fe3b792cdae65 100644 --- a/content/common/background_fetch/background_fetch_struct_traits.cc +++ b/content/common/background_fetch/background_fetch_struct_traits.cc @@ -28,7 +28,7 @@ bool StructTraits:: Read(blink::mojom::BackgroundFetchRegistrationDataView data, content::BackgroundFetchRegistration* registration) { - if (!data.ReadTag(®istration->tag) || + if (!data.ReadId(®istration->id) || !data.ReadIcons(®istration->icons) || !data.ReadTitle(®istration->title)) { return false; diff --git a/content/common/background_fetch/background_fetch_struct_traits.h b/content/common/background_fetch/background_fetch_struct_traits.h index d1d3ee3549d72e..2f2c67a945aee5 100644 --- a/content/common/background_fetch/background_fetch_struct_traits.h +++ b/content/common/background_fetch/background_fetch_struct_traits.h @@ -45,9 +45,9 @@ template <> struct CONTENT_EXPORT StructTraits { - static const std::string& tag( + static const std::string& id( const content::BackgroundFetchRegistration& registration) { - return registration.tag; + return registration.id; } static const std::vector& icons( const content::BackgroundFetchRegistration& registration) { diff --git a/content/common/background_fetch/background_fetch_struct_traits_unittest.cc b/content/common/background_fetch/background_fetch_struct_traits_unittest.cc index 92a6aa9ba4bf7e..c44f4aea87c8a9 100644 --- a/content/common/background_fetch/background_fetch_struct_traits_unittest.cc +++ b/content/common/background_fetch/background_fetch_struct_traits_unittest.cc @@ -59,7 +59,7 @@ TEST(BackgroundFetchStructTraitsTest, BackgroundFetchOptionsRoundtrip) { TEST(BackgroundFetchStructTraitsTest, BackgroundFetchRegistrationRoundTrip) { BackgroundFetchRegistration registration; - registration.tag = "my_tag"; + registration.id = "my_id"; registration.icons = { CreateIconDefinition("my_icon.png", "256x256", "image/png"), CreateIconDefinition("my_small_icon.jpg", "128x128", "image/jpg")}; @@ -71,7 +71,7 @@ TEST(BackgroundFetchStructTraitsTest, BackgroundFetchRegistrationRoundTrip) { blink::mojom::BackgroundFetchRegistration::Serialize(®istration), &roundtrip_registration)); - EXPECT_EQ(roundtrip_registration.tag, registration.tag); + EXPECT_EQ(roundtrip_registration.id, registration.id); ASSERT_EQ(roundtrip_registration.icons.size(), registration.icons.size()); for (size_t i = 0; i < registration.icons.size(); ++i) { diff --git a/content/common/background_fetch/background_fetch_types.h b/content/common/background_fetch/background_fetch_types.h index 263cfa618fa895..9286000226f0d5 100644 --- a/content/common/background_fetch/background_fetch_types.h +++ b/content/common/background_fetch/background_fetch_types.h @@ -52,7 +52,7 @@ struct CONTENT_EXPORT BackgroundFetchRegistration { BackgroundFetchRegistration(const BackgroundFetchRegistration& other); ~BackgroundFetchRegistration(); - std::string tag; + std::string id; std::vector icons; std::string title; int64_t total_download_size = 0; diff --git a/content/common/service_worker/service_worker_event_dispatcher.mojom b/content/common/service_worker/service_worker_event_dispatcher.mojom index 6c24be71bd60c7..96ec145cf6fb8e 100644 --- a/content/common/service_worker/service_worker_event_dispatcher.mojom +++ b/content/common/service_worker/service_worker_event_dispatcher.mojom @@ -93,17 +93,17 @@ interface ServiceWorkerEventDispatcher { DispatchActivateEvent() => (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time); - DispatchBackgroundFetchAbortEvent(string tag) + DispatchBackgroundFetchAbortEvent(string id) => (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time); - DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) + DispatchBackgroundFetchClickEvent(string id, BackgroundFetchState state) => (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time); - DispatchBackgroundFetchFailEvent(string tag, + DispatchBackgroundFetchFailEvent(string id, array fetches) => (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time); - DispatchBackgroundFetchedEvent(string tag, + DispatchBackgroundFetchedEvent(string id, array fetches) => (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time); @@ -134,7 +134,7 @@ interface ServiceWorkerEventDispatcher { mojo.common.mojom.Time dispatch_event_time); // Arguments are passed to the event handler as parameters of SyncEvent. // Ref: https://wicg.github.io/BackgroundSync/spec/#sync-event - DispatchSyncEvent(string tag, + DispatchSyncEvent(string id, blink.mojom.BackgroundSyncEventLastChance last_chance) => (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time); diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-expected.txt index cfb03ed224559c..74040ad4163148 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-expected.txt @@ -9,13 +9,13 @@ PASS BackgroundFetchManager interface: existence and properties of interface pro PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property PASS BackgroundFetchManager interface: operation fetch(DOMString,[object Object],[object Object],BackgroundFetchOptions) PASS BackgroundFetchManager interface: operation get(DOMString) -PASS BackgroundFetchManager interface: operation getTags() +PASS BackgroundFetchManager interface: operation getIds() PASS BackgroundFetchRegistration interface: existence and properties of interface object PASS BackgroundFetchRegistration interface object length PASS BackgroundFetchRegistration interface object name PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: attribute tag +PASS BackgroundFetchRegistration interface: attribute id PASS BackgroundFetchRegistration interface: attribute icons PASS BackgroundFetchRegistration interface: attribute totalDownloadSize PASS BackgroundFetchRegistration interface: attribute title diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-worker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-worker.https-expected.txt index e378d604678132..ca4bf0572bff56 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-worker.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-worker.https-expected.txt @@ -13,13 +13,13 @@ PASS BackgroundFetchManager interface: existence and properties of interface pro PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property PASS BackgroundFetchManager interface: operation fetch(DOMString,[object Object],[object Object],BackgroundFetchOptions) PASS BackgroundFetchManager interface: operation get(DOMString) -PASS BackgroundFetchManager interface: operation getTags() +PASS BackgroundFetchManager interface: operation getIds() PASS BackgroundFetchRegistration interface: existence and properties of interface object PASS BackgroundFetchRegistration interface object length PASS BackgroundFetchRegistration interface object name PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: attribute tag +PASS BackgroundFetchRegistration interface: attribute id PASS BackgroundFetchRegistration interface: attribute icons PASS BackgroundFetchRegistration interface: attribute totalDownloadSize PASS BackgroundFetchRegistration interface: attribute title @@ -44,7 +44,7 @@ PASS BackgroundFetchEvent interface object length PASS BackgroundFetchEvent interface object name FAIL BackgroundFetchEvent interface: existence and properties of interface prototype object Cannot read property 'has_extended_attribute' of undefined PASS BackgroundFetchEvent interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchEvent interface: attribute tag +PASS BackgroundFetchEvent interface: attribute id FAIL BackgroundFetchEndEvent interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchEndEvent" expected property "BackgroundFetchEndEvent" missing FAIL BackgroundFetchEndEvent interface object length assert_own_property: self does not have own property "BackgroundFetchEndEvent" expected property "BackgroundFetchEndEvent" missing FAIL BackgroundFetchEndEvent interface object name assert_own_property: self does not have own property "BackgroundFetchEndEvent" expected property "BackgroundFetchEndEvent" missing diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.idl b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.idl index 56edb5d69d3532..d8b2fedf316bde 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.idl +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.idl @@ -8,9 +8,9 @@ partial interface ServiceWorkerRegistration { [Exposed=(Window,Worker)] interface BackgroundFetchManager { - Promise fetch(DOMString tag, (RequestInfo or sequence) requests, optional BackgroundFetchOptions options); - Promise get(DOMString tag); - Promise> getTags(); + Promise fetch(DOMString id, (RequestInfo or sequence) requests, optional BackgroundFetchOptions options); + Promise get(DOMString id); + Promise> getIds(); // TODO: in future this should become an async iterator for BackgroundFetchRegistration objects }; @@ -32,7 +32,7 @@ dictionary IconDefinition { [Exposed=(Window,Worker)] interface BackgroundFetchRegistration { - readonly attribute DOMString tag; + readonly attribute DOMString id; readonly attribute FrozenArray icons; readonly attribute long totalDownloadSize; readonly attribute DOMString title; @@ -65,11 +65,11 @@ partial interface ServiceWorkerGlobalScope { [Constructor(DOMString type, BackgroundFetchEventInit init), Exposed=ServiceWorker] interface BackgroundFetchEvent : ExtendableEvent { - readonly attribute DOMString tag; + readonly attribute DOMString id; }; dictionary BackgroundFetchEventInit : ExtendableEventInit { - required DOMString tag; + required DOMString id; }; // 3.4.2. BackgroundFetchEndEvent diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.worker-expected.txt index fd4ad38ad0b306..6434ce8000be1d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.worker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.worker-expected.txt @@ -10,13 +10,13 @@ PASS BackgroundFetchManager interface: existence and properties of interface pro PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property PASS BackgroundFetchManager interface: operation fetch(DOMString,[object Object],[object Object],BackgroundFetchOptions) PASS BackgroundFetchManager interface: operation get(DOMString) -PASS BackgroundFetchManager interface: operation getTags() +PASS BackgroundFetchManager interface: operation getIds() PASS BackgroundFetchRegistration interface: existence and properties of interface object PASS BackgroundFetchRegistration interface object length PASS BackgroundFetchRegistration interface object name PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: attribute tag +PASS BackgroundFetchRegistration interface: attribute id PASS BackgroundFetchRegistration interface: attribute icons PASS BackgroundFetchRegistration interface: attribute totalDownloadSize PASS BackgroundFetchRegistration interface: attribute title diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-click-event.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-click-event.https.html index 91e652a9765a05..4a2bacb79d9f7b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-click-event.https.html +++ b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-click-event.https.html @@ -9,7 +9,7 @@

BackgroundFetchClickEvent

This test validates that the BackgroundFetchClickEvent is exposed and can -be constructed with a tag and a valid state.

+be constructed with an id and a valid state.

-

BackgroundFetchManager.getTags()

-

This test validates the behaviour of the getTags() method.

+

BackgroundFetchManager.getIds()

+

This test validates the behaviour of the getIds() method.

@@ -20,13 +20,13 @@

BackgroundFetchManager.getTags()

return service_worker_unregister_and_register(test, workerUrl, scope) .then(registration => { assert_equals(null, registration.active); - return registration.backgroundFetch.getTags(); + return registration.backgroundFetch.getIds(); }) .then(unreached_fulfillment(test), error => { assert_equals(error.name, 'TypeError'); }); -}, 'BackgroundFetchManager.getTags() requires an activated Service Worker.'); +}, 'BackgroundFetchManager.getIds() requires an activated Service Worker.'); promise_test(function(test) { let registration = null; @@ -36,16 +36,16 @@

BackgroundFetchManager.getTags()

registration = r; return wait_for_state(test, r.installing, 'activated'); }) - .then(() => registration.backgroundFetch.getTags()) - .then(tags => { - assert_true(Array.isArray(tags)); - assert_equals(tags.length, 0); + .then(() => registration.backgroundFetch.getIds()) + .then(ids => { + assert_true(Array.isArray(ids)); + assert_equals(ids.length, 0); }); -}, 'BackgroundFetchManager.getTags() returns an empty sequence by default.'); +}, 'BackgroundFetchManager.getIds() returns an empty sequence by default.'); promise_test(function(test) { - const tags = ['first-tag', 'second-tag', 'third-tag']; + const ids = ['first-id', 'second-id', 'third-id']; let registration = null; @@ -56,13 +56,13 @@

BackgroundFetchManager.getTags()

}) .then(() => { return Promise.all( - tags.map(tag => registration.backgroundFetch.fetch(tag, ['resources/non-existing-file.png']))); + ids.map(id => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png']))); }) - .then(() => registration.backgroundFetch.getTags()) - .then(receivedTags => { - assert_array_equals(receivedTags, tags); + .then(() => registration.backgroundFetch.getIds()) + .then(receivedIds => { + assert_array_equals(receivedIds, ids); }); -}, 'BackgroundFetchManager.getTags() returns a sequence of active fetches.'); +}, 'BackgroundFetchManager.getIds() returns a sequence of active fetches.'); diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-registration-abort.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-registration-abort.https.html index ecfcee3cf66790..220fa8ff1c7413 100644 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-registration-abort.https.html +++ b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-registration-abort.https.html @@ -18,7 +18,7 @@

BackgroundFetchRegistration.abort()

const scope = 'resources/scope/' + location.pathname; promise_test(function(test) { - const tag = 'my-background-fetch'; + const id = 'my-background-fetch'; let registration = null; let backgroundFetchRegistration = null; @@ -28,7 +28,7 @@

BackgroundFetchRegistration.abort()

registration = r; return wait_for_state(test, r.installing, 'activated'); }) - .then(() => registration.backgroundFetch.fetch(tag, ['resources/non-existing-file.png'])) + .then(() => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png'])) .then(r => { backgroundFetchRegistration = r; diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetched-event.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetched-event.https.html index 50300de2aa81a5..82cb0926886ac4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetched-event.https.html +++ b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetched-event.https.html @@ -10,7 +10,7 @@

BackgroundFetchedEvent

This test validates that the BackgroundFetchedEvent is exposed, and can be -constructed with a tag and a sequence of settled responses.

+constructed with an id and a sequence of settled responses.