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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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/fast/dom/script-tests/constructed-objects-prototypes.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js
deleted file mode 100644
index 1ebf908d60aeb4be536ab4327c47fbaab52a8390..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js
+++ /dev/null
@@ -1,75 +0,0 @@
-description("Make sure prototypes are set up using the window a property came from, instead of the lexical global object.")
-
-var subframe = document.createElement("iframe");
-document.body.appendChild(subframe);
-var inner = subframe.contentWindow; // Call it "inner" to make shouldBe output shorter
-
-// Stash a property on the prototypes.
-window.Object.prototype.isInner = false;
-inner.Object.prototype.isInner = true;
-
-function classNameForObject(object)
-{
- // call will use the global object if passed null or undefined, so special case those:
- if (object == null)
- return null;
- var result = Object.prototype.toString.call(object);
- // remove '[object ' and ']'
- return result.split(' ')[1].split(']')[0];
-}
-
-function constructorPropertiesOnWindow(globalObject)
-{
- var constructorNames = [];
- var propertyNames = Object.getOwnPropertyNames(window);
- for (var i = 0; i < propertyNames.length; i++) {
- var value = inner[propertyNames[i]];
- if (value == null)
- continue;
- var type = classNameForObject(value);
- // Ignore these properties because they do not exist in all implementations. They will be tested separately
- if (type == "WebGLRenderingContextConstructor" ||
- type == "ArrayBufferConstructor" ||
- type =="Float32ArrayConstructor" ||
- type =="Float64ArrayConstructor" ||
- type =="Int8ArrayConstructor" ||
- type =="Int16ArrayConstructor" ||
- type =="Int32ArrayConstructor" ||
- type =="Uint8ArrayConstructor" ||
- type =="Uint8ClampedArrayConstructor" ||
- type =="Uint16ArrayConstructor" ||
- type =="Uint32ArrayConstructor" ||
- type == "FileReaderConstructor" ||
- type == "AudioContextConstructor" ||
- type == "SpeechSynthesisUtteranceConstructor")
- continue;
- if (!type.match('Constructor$'))
- continue;
- constructorNames.push(property);
- }
- return constructorNames.sort();
-}
-
-var constructorNames = constructorPropertiesOnWindow(inner);
-
-var argumentsForConstructor = {
- 'Worker' : "'foo'",
-}
-
-for (var x = 0; x < constructorNames.length; x++) {
- var constructorName = constructorNames[x];
- var arguments = argumentsForConstructor[constructorName] || "";
- var argumentsString = "(" + arguments + ")";
- // Test first to see if the object is constructable
- var constructedObject;
- try {
- constructedObject = eval("new inner." + constructorName + argumentsString);
- } catch(e) {
- continue;
- }
-
- shouldBeTrue("(new inner." + constructorName + argumentsString + ").isInner");
- shouldBeTrue("(new inner." + constructorName + argumentsString + ").constructor.isInner");
-}
-
-document.body.removeChild(subframe);

Powered by Google App Engine
This is Rietveld 408576698