Commit 50743015 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions + Net] Add .mjs to MIME type mappings

Add .mjs to type mappings for the javascript MIME type. This is
necessary for .mjs to be recognized as a valid for use in modules
when served by the extension protocols, where the mime type is
determined by our net code (as opposed to a server).

Update the extension API test for modules to include a .mjs file test.

Bug: 857076
Change-Id: Ib14cabbc52057cfb57c933de5a9c3ed4b13b87d2
Reviewed-on: https://chromium-review.googlesource.com/1117203Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571921}
parent 7079e913
......@@ -5,6 +5,14 @@
// TODO(devlin): Sadly, there's no good way of checking that the import
// succeeds, so in the failure case the test just times out, rather than
// giving a useful error.
import {pass} from '/module.js';
import {pass as jsPass} from '/module.js';
import {pass as mjsPass} from '/module.mjs';
pass();
chrome.test.runTests([
function jsModule() {
jsPass();
},
function mjsModule() {
mjsPass();
},
]);
......@@ -3,5 +3,5 @@
// found in the LICENSE file.
export function pass() {
chrome.test.notifyPass();
chrome.test.succeed();
}
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export function pass() {
chrome.test.succeed();
}
......@@ -97,7 +97,7 @@ static const MimeInfo kPrimaryMappings[] = {
{"multipart/related", "mht,mhtml"},
{"text/css", "css"},
{"text/html", "html,htm,shtml,shtm"},
{"text/javascript", "js"},
{"text/javascript", "js,mjs"},
{"text/xml", "xml"},
{"video/mp4", "mp4,m4v"},
{"video/ogg", "ogv,ogm"},
......
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