Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/WebKit/LayoutTests/installedapp/resources/installedapp-test-helper.js

Issue 2748023002: getInstalledRelatedApps: Change internal url fields to URL type. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/installedapp/resources/installedapp-test-helper.js
diff --git a/third_party/WebKit/LayoutTests/installedapp/resources/installedapp-test-helper.js b/third_party/WebKit/LayoutTests/installedapp/resources/installedapp-test-helper.js
index 309fc1127d95f6a2a32f4b42925724f6114f373c..178822457e88d64db79cdd04c5050414d9016d8f 100644
--- a/third_party/WebKit/LayoutTests/installedapp/resources/installedapp-test-helper.js
+++ b/third_party/WebKit/LayoutTests/installedapp/resources/installedapp-test-helper.js
@@ -2,7 +2,15 @@
function assert_relatedapplication_equals(actual, expected, description) {
assert_equals(actual.platform, expected.platform, description);
- assert_equals(actual.url, expected.url, description);
+ // |url| can be a string (if comparing IDL RelatedApplications) or a
+ // url.mojom.Url (if comparing Mojo RelatedApplications). Either can be null.
+ assert_equals(actual.url === null, expected.url === null, description);
+ assert_equals(typeof(actual.url), typeof(expected.url), description);
+ if (typeof(actual.url) === 'object' && actual.url !== null) {
+ assert_equals(actual.url.url, expected.url.url, description);
+ } else {
+ assert_equals(actual.url, expected.url, description);
+ }
assert_equals(actual.id, expected.id, description);
}
@@ -17,9 +25,10 @@ function assert_array_relatedapplication_equals(
let mockInstalledAppProvider = loadMojoModules(
'mockInstalledAppProvider',
['mojo/public/js/bindings',
+ 'url/mojo/url.mojom',
'third_party/WebKit/public/platform/modules/installedapp/installed_app_provider.mojom',
]).then(mojo => {
- let [bindings, installedAppProvider] = mojo.modules;
+ let [bindings, urlModule, installedAppProvider] = mojo.modules;
class MockInstalledAppProvider {
constructor(interfaceProvider) {
@@ -39,6 +48,11 @@ let mockInstalledAppProvider = loadMojoModules(
return new Promise((resolve, reject) => {this.reject_ = reject});
}
+ // Creates a url.mojom.Url from a URL string.
+ makeUrl(url) {
+ return new urlModule.Url({url: url});
+ }
+
filterInstalledApps(relatedApps) {
let callback = null;
let result = new Promise(resolve => {callback = resolve;});

Powered by Google App Engine
This is Rietveld 408576698