Bug 881997 - Test to assure that conformance is only exposed on our conformant products. - r=dzbarsky

This commit is contained in:
Jeff Gilbert 2013-07-09 17:46:25 -07:00
parent bb4414693d
commit 3312535c9d
4 changed files with 47 additions and 0 deletions

View File

@ -4,3 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['non-conf-tests']

View File

@ -0,0 +1,18 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
test_webgl_conformance.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,5 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<title>WebGL test: 'webgl' context request</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c"></canvas>
<script>
var canvas = document.getElementById('c');
var gl = canvas.getContext('webgl');
var isAndroid = /Android/.test(navigator.userAgent);
var shouldBeConformant = !isAndroid;
if (shouldBeConformant) {
ok(gl, 'Expected conformance on: ' + navigator.userAgent);
} else {
ok(!gl, 'Unexpected conformance on: ' + navigator.userAgent);
}
</script>