content/canvas/test/webgl-conformance/conformance/context/resource-sharing-test.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/canvas/test/webgl-conformance/conformance/context/resource-sharing-test.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +<!--
     1.5 +Copyright (c) 2011 The Chromium Authors. All rights reserved.
     1.6 +Use of this source code is governed by a BSD-style license that can be
     1.7 +found in the LICENSE file.
     1.8 + -->
     1.9 +<!DOCTYPE html>
    1.10 +<html>
    1.11 +  <head>
    1.12 +<meta charset="utf-8">
    1.13 +    <title>WebGL Resource Sharing.</title>
    1.14 +    <link rel="stylesheet" href="../../resources/js-test-style.css"/>
    1.15 +    <script src="../../resources/js-test-pre.js"></script>
    1.16 +    <script src="../resources/webgl-test.js"> </script>
    1.17 +    <script src="../../debug/webgl-debug.js"> </script>
    1.18 +</head>
    1.19 +<body>
    1.20 +<canvas id="example1" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
    1.21 +<canvas id="example2" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
    1.22 +<div id="description"></div>
    1.23 +<div id="console"></div>
    1.24 +<script>
    1.25 +description("Tests that resources can not be shared.");
    1.26 +debug("");
    1.27 +
    1.28 +var gl1 = create3DContext(document.getElementById("example1"));
    1.29 +var gl2 = create3DContext(document.getElementById("example2"));
    1.30 +assertMsg(gl1 && gl2,
    1.31 +          "Got 3d context.");
    1.32 +
    1.33 +var vertexObject = gl1.createBuffer();
    1.34 +gl2.bindBuffer(gl2.ARRAY_BUFFER, vertexObject);
    1.35 +assertMsg(
    1.36 +  gl2.getError() == gl2.INVALID_OPERATION,
    1.37 +  "attempt to use a resource from the wrong context should fail with INVALID_OPERATION");
    1.38 +
    1.39 +successfullyParsed = true;
    1.40 +</script>
    1.41 +<script>finishTest();</script>
    1.42 +</body>
    1.43 +</html>
    1.44 +

mercurial