Commit 431a8a1d authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

[Background Fetch] Update Options and UIOptions IDL definitions

TBR=dcheng@chromium.org

Bug: 865063
Change-Id: Ieca1efe67cbc9b0340f4bc9f1e0e5af9a0a0391d
Reviewed-on: https://chromium-review.googlesource.com/1160442
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarRayan Kanso <rayankans@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580257}
parent 388ad143
......@@ -84,7 +84,7 @@ PASS BackgroundFetchUpdateEvent interface object name
PASS BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object
PASS BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object's "constructor" property
PASS BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object's @@unscopables property
PASS BackgroundFetchUpdateEvent interface: operation updateUI(DOMString)
FAIL BackgroundFetchUpdateEvent interface: operation updateUI(DOMString) assert_equals: property has wrong .length expected 1 but got 0
PASS BackgroundFetchClickEvent interface: existence and properties of interface object
PASS BackgroundFetchClickEvent interface object length
PASS BackgroundFetchClickEvent interface object name
......
......@@ -2,11 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://wicg.github.io/background-fetch/#background-fetch-manager
// https://wicg.github.io/background-fetch/#dictdef-backgroundfetchoptions
dictionary BackgroundFetchOptions {
sequence<ImageResource> icons = [];
DOMString title = "";
[ImplementedAs=downloadTotal] unsigned long long totalDownloadSize = 0;
dictionary BackgroundFetchOptions : BackgroundFetchUIOptions {
unsigned long long downloadTotal = 0;
};
......@@ -42,7 +42,7 @@ blink::mojom::blink::BackgroundFetchOptionsPtr TypeConverter<
mojo_options->icons = std::move(mojo_icons);
mojo_options->download_total = options.downloadTotal();
mojo_options->title = options.title();
mojo_options->title = options.hasTitle() ? options.title() : "";
return mojo_options;
}
......
......@@ -2,12 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://wicg.github.io/background-fetch/#backgroundfetchupdateevent
// https://wicg.github.io/background-fetch/#dictdef-backgroundfetchuioptions
// TODO(crbug.com/865063): Fix names after the standard is updated.
// Spec Bug: https://github.com/WICG/background-fetch/issues/86
dictionary BackgroundFetchUpdateUIOptions {
DOMString? title;
dictionary BackgroundFetchUIOptions {
sequence<ImageResource> icons = [];
DOMString? title;
};
......@@ -13,7 +13,7 @@
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_bridge.h"
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_icon_loader.h"
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_settled_fetch.h"
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_update_ui_options.h"
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_ui_options.h"
#include "third_party/blink/renderer/modules/event_modules_names.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
......@@ -45,7 +45,7 @@ void BackgroundFetchUpdateEvent::Trace(blink::Visitor* visitor) {
ScriptPromise BackgroundFetchUpdateEvent::updateUI(
ScriptState* script_state,
const BackgroundFetchUpdateUIOptions& ui_options) {
const BackgroundFetchUIOptions& ui_options) {
if (!registration_) {
// Return a Promise that will never settle when a developer calls this
// method on a BackgroundFetchedEvent instance they created themselves.
......
......@@ -12,7 +12,7 @@
namespace blink {
class BackgroundFetchIconLoader;
class BackgroundFetchUpdateUIOptions;
class BackgroundFetchUIOptions;
// Event for interacting with fetch requests that have completed.
class MODULES_EXPORT BackgroundFetchUpdateEvent final
......@@ -41,7 +41,7 @@ class MODULES_EXPORT BackgroundFetchUpdateEvent final
// Web Exposed method defined in the IDL file.
ScriptPromise updateUI(ScriptState* script_state,
const BackgroundFetchUpdateUIOptions& ui_options);
const BackgroundFetchUIOptions& ui_options);
void Trace(blink::Visitor* visitor) override;
......
......@@ -10,5 +10,5 @@
RuntimeEnabled=BackgroundFetch
]
interface BackgroundFetchUpdateEvent : BackgroundFetchSettledEvent {
[CallWith=ScriptState] Promise<void> updateUI(BackgroundFetchUpdateUIOptions options);
[CallWith=ScriptState] Promise<void> updateUI(optional BackgroundFetchUIOptions options);
};
\ No newline at end of file
......@@ -470,7 +470,7 @@ modules_dictionary_idl_files =
"background_fetch/background_fetch_fail_event_init.idl",
"background_fetch/background_fetch_options.idl",
"background_fetch/background_fetch_settled_event_init.idl",
"background_fetch/background_fetch_update_ui_options.idl",
"background_fetch/background_fetch_ui_options.idl",
"background_sync/sync_event_init.idl",
"bluetooth/bluetooth_le_scan_filter_init.idl",
"bluetooth/request_device_options.idl",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment