Bug 1312330 - Add 'Exposed' attribute to pass the test criteria of the idlharness.js in WPT. r=bkelly
authorBevis Tseng <btseng@mozilla.com>
Mon, 24 Oct 2016 15:57:54 +0800
changeset 346667 7020b2be1285accf881347179245f7ef9e92c474
parent 346666 f7823287275f2c2c4e2329b75057c12fc31cc806
child 346668 35b7ac956b896839e669a1a8aecc1ff063449aa3
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1312330
milestone52.0a1
Bug 1312330 - Add 'Exposed' attribute to pass the test criteria of the idlharness.js in WPT. r=bkelly
testing/web-platform/meta/IndexedDB/interfaces.worker.js.ini
testing/web-platform/tests/IndexedDB/interfaces.html
testing/web-platform/tests/IndexedDB/interfaces.idl
testing/web-platform/tests/IndexedDB/interfaces.worker.js
deleted file mode 100644
--- a/testing/web-platform/meta/IndexedDB/interfaces.worker.js.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-[interfaces.worker]
-  type: testharness
-  [WorkerGlobalScope interface: existence and properties of interface object]
-    expected: FAIL
-
-  [Event interface: existence and properties of interface object]
-    expected: FAIL
-
-  [EventTarget interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBKeyRange interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBRequest interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBOpenDBRequest interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBVersionChangeEvent interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBFactory interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBDatabase interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBObjectStore interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBIndex interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBCursor interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBCursorWithValue interface: existence and properties of interface object]
-    expected: FAIL
-
-  [IDBTransaction interface: existence and properties of interface object]
-    expected: FAIL
-
--- a/testing/web-platform/tests/IndexedDB/interfaces.html
+++ b/testing/web-platform/tests/IndexedDB/interfaces.html
@@ -16,18 +16,18 @@ setup(function() {
 
   var request = new XMLHttpRequest();
   request.open("GET", "interfaces.idl");
   request.send();
   request.onload = function() {
     var idls = request.responseText;
 
     idlArray.add_untested_idls("[PrimaryGlobal] interface Window { };");
-    idlArray.add_untested_idls("interface Event { };");
-    idlArray.add_untested_idls("interface EventTarget { };");
+    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };");
+    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget { };");
 
     // From Indexed DB:
     idlArray.add_idls(idls);
     idlArray.add_idls("Window implements IDBEnvironment;");
 
     idlArray.add_objects({
       IDBCursor: [],
       IDBCursorWithValue: [],
--- a/testing/web-platform/tests/IndexedDB/interfaces.idl
+++ b/testing/web-platform/tests/IndexedDB/interfaces.idl
@@ -4,16 +4,17 @@ enum IDBTransactionMode {
     "versionchange"
 };
 
 enum IDBRequestReadyState {
     "pending",
     "done"
 };
 
+[Exposed=(Window,Worker)]
 interface IDBKeyRange {
     readonly    attribute any     lower;
     readonly    attribute any     upper;
     readonly    attribute boolean lowerOpen;
     readonly    attribute boolean upperOpen;
     static IDBKeyRange only (any value);
     static IDBKeyRange lowerBound (any lower, optional boolean open = false);
     static IDBKeyRange upperBound (any upper, optional boolean open = false);
@@ -37,62 +38,68 @@ dictionary IDBIndexParameters {
     boolean multiEntry = false;
 };
 
 dictionary IDBVersionChangeEventInit : EventInit {
     unsigned long long  oldVersion = 0;
     unsigned long long? newVersion = null;
 };
 
+[Exposed=(Window,Worker)]
 interface IDBRequest : EventTarget {
     readonly    attribute any                                        result;
     readonly    attribute DOMError                                   error;
     readonly    attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
     readonly    attribute IDBTransaction                             transaction;
     readonly    attribute IDBRequestReadyState                       readyState;
                 attribute EventHandler                               onsuccess;
                 attribute EventHandler                               onerror;
 };
 
+[Exposed=(Window,Worker)]
 interface IDBOpenDBRequest : IDBRequest {
                 attribute EventHandler onblocked;
                 attribute EventHandler onupgradeneeded;
 };
 
-[Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
+[Exposed=(Window,Worker),
+ Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
 interface IDBVersionChangeEvent : Event {
     readonly    attribute unsigned long long  oldVersion;
     readonly    attribute unsigned long long? newVersion;
 };
 
 [NoInterfaceObject]
 interface IDBEnvironment {
     readonly    attribute IDBFactory indexedDB;
 };
 
+[Exposed=(Window,Worker)]
 interface IDBFactory {
     IDBOpenDBRequest open (DOMString name, [EnforceRange] optional unsigned long long version);
     IDBOpenDBRequest deleteDatabase (DOMString name);
     short            cmp (any first, any second);
 };
 
+[Exposed=(Window,Worker)]
 interface IDBDatabase : EventTarget {
     readonly    attribute DOMString          name;
     readonly    attribute unsigned long long version;
     readonly    attribute DOMStringList      objectStoreNames;
     IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
     void           deleteObjectStore (DOMString name);
     IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames, optional IDBTransactionMode mode = "readonly");
     void           close ();
                 attribute EventHandler       onabort;
                 attribute EventHandler       onclose;
                 attribute EventHandler       onerror;
                 attribute EventHandler       onversionchange;
 };
 
+[Exposed=(Window,Worker)]
 interface IDBObjectStore {
     attribute DOMString name;
     readonly    attribute any            keyPath;
     readonly    attribute DOMStringList  indexNames;
     readonly    attribute IDBTransaction transaction;
     readonly    attribute boolean        autoIncrement;
     IDBRequest put (any value, optional any key);
     IDBRequest add (any value, optional any key);
@@ -101,44 +108,48 @@ interface IDBObjectStore {
     IDBRequest clear ();
     IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
     IDBIndex   createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters);
     IDBIndex   index (DOMString name);
     void       deleteIndex (DOMString indexName);
     IDBRequest count (optional any key);
 };
 
+[Exposed=(Window,Worker)]
 interface IDBIndex {
     attribute DOMString name;
     readonly    attribute IDBObjectStore objectStore;
     readonly    attribute any            keyPath;
     readonly    attribute boolean        multiEntry;
     readonly    attribute boolean        unique;
     IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
     IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
     IDBRequest get (any key);
     IDBRequest getKey (any key);
     IDBRequest count (optional any key);
 };
 
+[Exposed=(Window,Worker)]
 interface IDBCursor {
     readonly    attribute (IDBObjectStore or IDBIndex) source;
     readonly    attribute IDBCursorDirection           direction;
     readonly    attribute any                          key;
     readonly    attribute any                          primaryKey;
     IDBRequest update (any value);
     void       advance ([EnforceRange] unsigned long count);
     void       continue (optional any key);
     IDBRequest delete ();
 };
 
+[Exposed=(Window,Worker)]
 interface IDBCursorWithValue : IDBCursor {
     readonly    attribute any value;
 };
 
+[Exposed=(Window,Worker)]
 interface IDBTransaction : EventTarget {
     readonly    attribute IDBTransactionMode mode;
     readonly    attribute IDBDatabase        db;
     readonly    attribute DOMError           error;
     IDBObjectStore objectStore (DOMString name);
     void           abort ();
                 attribute EventHandler       onabort;
                 attribute EventHandler       oncomplete;
--- a/testing/web-platform/tests/IndexedDB/interfaces.worker.js
+++ b/testing/web-platform/tests/IndexedDB/interfaces.worker.js
@@ -5,19 +5,19 @@ importScripts("/resources/WebIDLParser.j
 
 var request = new XMLHttpRequest();
 request.open("GET", "interfaces.idl");
 request.send();
 request.onload = function() {
   var idlArray = new IdlArray();
   var idls = request.responseText;
 
-  idlArray.add_untested_idls("interface WorkerGlobalScope {};");
-  idlArray.add_untested_idls("interface Event { };");
-  idlArray.add_untested_idls("interface EventTarget { };");
+  idlArray.add_untested_idls("[Exposed=Worker] interface WorkerGlobalScope {};");
+  idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };");
+  idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget { };");
 
   // From Indexed DB:
   idlArray.add_idls("WorkerGlobalScope implements IDBEnvironment;");
   idlArray.add_idls(idls);
 
   idlArray.add_objects({
     IDBCursor: [],
     IDBCursorWithValue: [],