Commit a536f89f authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Clean up some chrome://media-app/../drop_target.js remnants.

This used to be loaded at runtime. But now it is not.

Bug: b/162187144
Change-Id: Ia627641964149ae754c2d5b086fd8c261788be64
Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437559Reviewed-by: default avatardstockwell <dstockwell@google.com>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812002}
parent 41823497
...@@ -33,8 +33,6 @@ content::WebUIDataSource* CreateMediaAppUntrustedDataSource( ...@@ -33,8 +33,6 @@ content::WebUIDataSource* CreateMediaAppUntrustedDataSource(
source->AddResourcePath("js/app_main.js", IDR_MEDIA_APP_APP_MAIN_JS); source->AddResourcePath("js/app_main.js", IDR_MEDIA_APP_APP_MAIN_JS);
source->AddResourcePath("js/app_image_handler_module.js", source->AddResourcePath("js/app_image_handler_module.js",
IDR_MEDIA_APP_APP_IMAGE_HANDLER_MODULE_JS); IDR_MEDIA_APP_APP_IMAGE_HANDLER_MODULE_JS);
source->AddResourcePath("js/app_drop_target_module.js",
IDR_MEDIA_APP_APP_DROP_TARGET_MODULE_JS);
// Add all resources from chromeos_media_app_bundle_resources.pak. // Add all resources from chromeos_media_app_bundle_resources.pak.
for (size_t i = 0; i < kChromeosMediaAppBundleResourcesSize; i++) { for (size_t i = 0; i < kChromeosMediaAppBundleResourcesSize; i++) {
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
file="js/mock_module.js" file="js/mock_module.js"
compress="brotli" compress="brotli"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_MEDIA_APP_APP_DROP_TARGET_MODULE_JS"
file="js/mock_module.js"
compress="brotli"
type="BINDATA" />
<!-- Use a placeholder icon when enable_cros_media_app = false. --> <!-- Use a placeholder icon when enable_cros_media_app = false. -->
<include name="IDR_MEDIA_APP_APP_ICON_256_PNG" <include name="IDR_MEDIA_APP_APP_ICON_256_PNG"
file="../../../../../ui/file_manager/gallery/images/icon256.png" file="../../../../../ui/file_manager/gallery/images/icon256.png"
......
...@@ -6,16 +6,34 @@ ...@@ -6,16 +6,34 @@
// Test web workers can be spawned from chrome-untrusted://media-app. Errors // Test web workers can be spawned from chrome-untrusted://media-app. Errors
// will be logged in console from web_ui_browser_test.cc. // will be logged in console from web_ui_browser_test.cc.
GUEST_TEST('GuestCanSpawnWorkers', () => { GUEST_TEST('GuestCanSpawnWorkers', async () => {
let error = null; let caughtError = null;
let networkErrorEventType = '';
try { try {
const worker = new Worker('js/app_drop_target_module.js'); // The "real" webworker isn't needed for the mock, but we want to test CSP
// errors. Fetch something that doesn't exist. This has a bonus that we can
// wait for an "error" event, whereas fetching a "real" file would require
// it to respond to a postMessage. Note the resource will 404, but that
// won't throw an exception. CSP errors, however, will throw errors that
// fail the test. E.g., Failed to construct 'Worker': Script at
// 'about:blank' cannot be accessed from origin
// 'chrome-untrusted://media-app'.
const worker = new Worker('/non-existent.js');
// Await the network error to ensure things get that far. The error itself
// is entirely opaque.
networkErrorEventType = await new Promise(resolve => {
worker.onerror = (event) => {
resolve(event.type);
};
});
} catch (e) { } catch (e) {
error = e; caughtError = e;
} }
assertEquals(error, null, error && error.message); assertEquals(caughtError, null, caughtError && caughtError.message);
assertEquals(networkErrorEventType, 'error');
}); });
// Test that language is set correctly on the guest iframe. // Test that language is set correctly on the guest iframe.
......
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