Commit 93a43dd4 authored by Wei Lee's avatar Wei Lee Committed by Commit Bot

Returns window url to callback when the window is created

This CL returns the window url when the window is created so that tests
could distinguish between regular instance and intent handling instance.

This CL is needed for adding corresponding tests in
tast.camera.CCAUIIntent:
https://crrev.com/c/1858065

Bug: b/139650048
Test: tast run [DUT] camera.CCAUIIntent
Change-Id: I7eb0d06932bd1cddf6709f291897659dda0c5769
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859420
Commit-Queue: Wei Lee <wtlee@chromium.org>
Reviewed-by: default avatarKuo Jen Wei <inker@chromium.org>
Reviewed-by: default avatarShik Chen <shik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709414}
parent 0aa4d6e2
......@@ -38,7 +38,7 @@ cca.bg.TOPBAR_COLOR = '#000000';
/**
* It's used in test to ensure that we won't connect to the main.html target
* before the window is created, otherwise the window might disappear.
* @type {?function(*): undefined}
* @type {?function(string): undefined}
*/
cca.bg.onAppWindowCreatedForTesting = null;
......@@ -192,7 +192,7 @@ cca.bg.Window = class {
this.onSuspended_(this);
};
if (cca.bg.onAppWindowCreatedForTesting !== null) {
cca.bg.onAppWindowCreatedForTesting(null);
cca.bg.onAppWindowCreatedForTesting(windowUrl);
}
});
}
......@@ -457,7 +457,9 @@ cca.bg.Background = class {
* Handles messages from the test extension used in Tast.
* @param {*} message The message sent by the calling script.
* @param {!MessageSender} sender
* @param {function(*): void} sendResponse
* @param {function(string): undefined} sendResponse The callback function which
* expects to receive the url of the window when the window is successfully
* created.
* @return {boolean|undefined} True to indicate the response is sent
* asynchronously.
*/
......
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