summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html
diff options
context:
space:
mode:
authorsigbjornf@opera.com <sigbjornf@opera.com>2015-03-24 19:52:03 +0000
committersigbjornf@opera.com <sigbjornf@opera.com>2015-03-24 19:52:03 +0000
commit8c078711366e28782a15687715d3e3d5e3912da6 (patch)
tree46832c1beda63d3d13312bff37d1bff1d8843c45 /third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html
parentc5cb1b685a3262a504160ff579267e9f8812e5e4 (diff)
downloadchromium_src-8c078711366e28782a15687715d3e3d5e3912da6.zip
chromium_src-8c078711366e28782a15687715d3e3d5e3912da6.tar.gz
chromium_src-8c078711366e28782a15687715d3e3d5e3912da6.tar.bz2
Mark wrappers of canvas rendering context objects as dependent.
When initially called, canvas.getContext() will return a fresh rendering context object, but at the same time switch its "context mode" to a direct one (2d or webgl), such that subsequent getContext() with the same contextID argument will return that initially created context object. To correctly provide that same-object identity, the wrapper object must be marked as depending on the canvas element object, such that it will be retained across GCs. R=junov,haraken BUG=450410 Review URL: https://codereview.chromium.org/1033613002 git-svn-id: svn://svn.chromium.org/blink/trunk@192465 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html')
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html
new file mode 100644
index 0000000..2ec7253
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description("Verify that the custom properties on a Canvas 2D rendering context object are retained across GCs.");
+
+window.jsTestIsAsync = true;
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+function runTest() {
+ canvas = document.createElement("canvas");
+ context = canvas.getContext("2d");
+ context.customProperty = "value";
+ shouldBeEqualToString("context.customProperty", "value");
+ context = null;
+ gc();
+ context = canvas.getContext("2d");
+ shouldBeEqualToString("context.customProperty", "value");
+ finishJSTest();
+}
+
+window.onload = runTest;
+</script>
+</body>
+</html>