| Index: third_party/WebKit/LayoutTests/plugins/navigator-plugins-mimeTypes-comparison.html
|
| diff --git a/third_party/WebKit/LayoutTests/plugins/navigator-plugins-mimeTypes-comparison.html b/third_party/WebKit/LayoutTests/plugins/navigator-plugins-mimeTypes-comparison.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cf27b847feb8321b8e2bf924852c689fa1dd1972
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/plugins/navigator-plugins-mimeTypes-comparison.html
|
| @@ -0,0 +1,39 @@
|
| +<!doctype html>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script>
|
| +test(() => {
|
| + // Ensure test plugin is loaded
|
| + navigator.plugins.refresh(false);
|
| + assert_true(navigator.mimeTypes.length > 0);
|
| + assert_true(navigator.plugins.length > 0);
|
| +
|
| + for (var i = 0; i < navigator.plugins.length; i++) {
|
| + assert_equals(navigator.mimeTypes[i], navigator.mimeTypes[i]);
|
| + assert_equals(navigator.mimeTypes[navigator.mimeTypes[i].type], navigator.mimeTypes[i]);
|
| + assert_equals(navigator.plugins[i], navigator.plugins[i]);
|
| + assert_equals(navigator.plugins[navigator.plugins[i].name], navigator.plugins[i]);
|
| +
|
| + // Only application/x-blink-test-plugin mimetype is associated with the test plugin.
|
| + // It should have the same ordinal as the test plugin in the plugin array.
|
| + if (navigator.plugins[i].name != "Blink Test Plugin")
|
| + continue;
|
| +
|
| + assert_equals(navigator.mimeTypes[i].type, "application/x-blink-test-plugin");
|
| + assert_equals(navigator.mimeTypes["application/x-blink-test-plugin"], navigator.mimeTypes[i]);
|
| + assert_equals(navigator.mimeTypes["application/x-blink-test-plugin"].enabledPlugin, navigator.plugins[i]);
|
| + assert_equals(navigator.plugins[i].item(0), navigator.mimeTypes[i]);
|
| + assert_equals(navigator.plugins[i].namedItem("application/x-blink-test-plugin"), navigator.mimeTypes[i]);
|
| + }
|
| +
|
| + // Test that the plugins/mimeTypes DOM objects cache is cleared after refresh.
|
| + var plugin = navigator.plugins[0];
|
| + var mimetype = navigator.mimeTypes[0];
|
| + navigator.plugins.refresh(false);
|
| + var plugin2 = navigator.plugins[0];
|
| + var mimetype2 = navigator.mimeTypes[0];
|
| + assert_not_equals(plugin, plugin2);
|
| + assert_not_equals(mimetype, mimetype2);
|
| +}, "Test for bug 616662: The mimeTypes and plugins objects on navigator return new objects when indexed by the same ordinal.");
|
| +</script>
|
| +
|
|
|