diff --git a/proximity/DeviceProximityEvent_tests.js b/proximity/DeviceProximityEvent_tests.js index 933e66bef6b505..57f5647694ab20 100644 --- a/proximity/DeviceProximityEvent_tests.js +++ b/proximity/DeviceProximityEvent_tests.js @@ -1,32 +1,3 @@ -/** -* W3C 3-clause BSD License -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are -* met: -* o Redistributions of works must retain the original copyright notice, -* this list of conditions and the following disclaimer. -* -* o Redistributions in binary form must reproduce the original copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* -* o Neither the name of the W3C nor the names of its contributors may be -* used to endorse or promote products derived from this work without -* specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -**/ - (function() { //inheritance tests test(function() { @@ -41,7 +12,7 @@ //Type attribute tests test(function() { - assert_throws(null, function() { + assert_throws(new TypeError(), function() { new DeviceProximityEvent(); }, 'First argument is required, so was expecting a TypeError.'); }, 'Missing type argument'); @@ -94,7 +65,7 @@ test(function() { var event = new DeviceProximityEvent(new Boolean(true)); assert_equals(event.type, 'true'); - }, 'type argument is instance of boolean'); + }, 'type argument is instance of Boolean (true)'); test(function() { var event = new DeviceProximityEvent(false); @@ -104,17 +75,17 @@ test(function() { var event = new DeviceProximityEvent(new Boolean(false)); assert_equals(event.type, 'false'); - }, ''); + }, 'type argument is instance of Boolean (false)'); test(function() { var event = new DeviceProximityEvent('test'); assert_equals(event.type, 'test'); - }, 'type argument is instance of boolean (false)'); + }, 'type argument is string'); test(function() { var event = new DeviceProximityEvent(new String('test')); assert_equals(event.type, 'test'); - }, 'type argument is string'); + }, 'type argument is instance of String'); test(function() { var event = new DeviceProximityEvent(function test() {}); diff --git a/proximity/ProximityEvent_tests.html b/proximity/ProximityEvent_tests.html new file mode 100644 index 00000000000000..b723ba0d3877d3 --- /dev/null +++ b/proximity/ProximityEvent_tests.html @@ -0,0 +1,9 @@ + + + +Proximity Events Test Suite +

Test Suite for Proximity Events

+
+ + + diff --git a/proximity/UserProximityEvent_tests.js b/proximity/UserProximityEvent_tests.js index feaed0de9fbfef..cb10ab90d7564b 100644 --- a/proximity/UserProximityEvent_tests.js +++ b/proximity/UserProximityEvent_tests.js @@ -40,7 +40,7 @@ //Type attribute tests test(function() { - assert_throws(null, function() { + assert_throws(new TypeError(), function() { new UserProximityEvent(); }, 'First argument is required, so was expecting a TypeError.'); }, 'Missing type argument'); @@ -93,7 +93,7 @@ test(function() { var event = new UserProximityEvent(new Boolean(true)); assert_equals(event.type, 'true'); - }, 'type argument is instance of boolean'); + }, 'type argument is instance of Boolean (true)'); test(function() { var event = new UserProximityEvent(false); @@ -103,17 +103,17 @@ test(function() { var event = new UserProximityEvent(new Boolean(false)); assert_equals(event.type, 'false'); - }, ''); + }, 'type argument is instance of Boolean (false)'); test(function() { var event = new UserProximityEvent('test'); assert_equals(event.type, 'test'); - }, 'type argument is instance of boolean (false)'); + }, 'type argument is string'); test(function() { var event = new UserProximityEvent(new String('test')); assert_equals(event.type, 'test'); - }, 'type argument is string'); + }, 'type argument is instance of String'); test(function() { var event = new UserProximityEvent(function test() {}); @@ -170,56 +170,56 @@ near: undefined }); assert_equals(event.near, false, 'argument is truthy'); - }, 'near set to a falsy object'); + }, 'near set to undefined'); test(function() { var event = new UserProximityEvent('test', { near: null }); assert_equals(event.near, false, 'argument is flasy'); - }, 'near set to a falsy object'); + }, 'near set to null'); test(function() { var event = new UserProximityEvent('test', { near: 0 }); assert_equals(event.near, false, 'argument is flasy'); - }, 'near set to a falsy object'); + }, 'near set to 0'); test(function() { var event = new UserProximityEvent('test', { near: '' }); assert_equals(event.near, false, 'argument is flasy'); - }, 'near set to a falsy object'); + }, 'near set to empty string'); test(function() { var event = new UserProximityEvent('test', { near: '\u0020' }); assert_equals(event.near, true, 'argument is truthy'); - }, 'near set to a truthy object'); + }, 'near set to U+0020'); test(function() { var event = new UserProximityEvent('test', { near: 1 }); assert_equals(event.near, true, 'argument is truthy'); - }, 'near set to a truthy object'); + }, 'near set to 1'); test(function() { var event = new UserProximityEvent('test', { near: [] }); assert_equals(event.near, true, 'argument is truthy'); - }, 'near set to a truthy object'); + }, 'near set to []'); test(function() { var event = new UserProximityEvent('test', { near: {} }); assert_equals(event.near, true, 'argument is truthy'); - }, 'near set to a truthy object'); + }, 'near set to {}'); test(function() { var dict = { @@ -247,7 +247,6 @@ var desc = 'window.onuserproximity did not accept callable object', func = function() {}, desc = 'onuserproximity does not exist'; - assert_idl_attribute(window, 'onuserproximity', desc); window.onuserproximity = func; assert_equals(window.onuserproximity, func, desc); }, 'onuserproximity exists and can be set to a function'); diff --git a/proximity/index.html b/proximity/index.html deleted file mode 100644 index 50054bae0fe9dc..00000000000000 --- a/proximity/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - -Proximity Events Test Suite - -

Test Suite for Proximity Events

-
-
-

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

- - - diff --git a/proximity/manifest.txt b/proximity/manifest.txt index 033135b2fe9174..c7293d01e9a9bf 100644 --- a/proximity/manifest.txt +++ b/proximity/manifest.txt @@ -1,3 +1,2 @@ -index.html -index.html +ProximityEvent_tests.html