[common][webmessaging][DPTTIZEN-3178, update tc for web engine version upgrade] 65/225365/1
authorqunfang.lin <qunfang.lin@samsung.com>
Thu, 20 Feb 2020 01:12:09 +0000 (09:12 +0800)
committerqunfang.lin <qunfang.lin@samsung.com>
Thu, 20 Feb 2020 01:18:04 +0000 (09:18 +0800)
modify: 3 TCs

Change-Id: Ia8cfd1bfab3797d5a1f9dbc20d8380278518d232
Signed-off-by: qunfang.lin <qunfang.lin@samsung.com>
common/tct-webmessaging-w3c-tests/webmessaging/w3c/with-ports/016.html
common/tct-webmessaging-w3c-tests/webmessaging/w3c/without-ports/008.html
common/tct-webmessaging-w3c-tests/webmessaging/w3c/without-ports/016.html

index 946c65a79e8ae7ebde8231a3829dc687a803c369..6b979ab54702635de808eed512588e95c5fee3ef 100755 (executable)
@@ -2,13 +2,18 @@
 <title>origin of the script that invoked the method, data:</title>
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
-<iframe src="data:text/html"></iframe>
+<iframe src="data:text/html,<script>onmessage = function(e) { parent.postMessage(e.origin, '*'); }; parent.postMessage('loaded', '*');</script>"></iframe>
 <div id=log></div>
 <script>
 async_test(function() {
-  window[0].postMessage('', '*', []);
-  window[0].onmessage = this.step_func(function(e) {
-    assert_equals(e.origin, location.protocol + '//' + location.host);
+  onmessage = this.step_func(function(e) {
+    if (e.data === 'loaded') {
+      window[0].postMessage('', '*');
+      return;
+    }
+
+    assert_equals(e.data, location.protocol + '//' + location.host);
+    assert_equals(e.origin, 'null');
     assert_array_equals(e.ports, []);
     this.done();
   });
index 84f2f1a552155c86ec16f2b6e7011074edaaa191..ae02d6f78bb92d300ee82419be521a6e4ed05270 100755 (executable)
@@ -5,8 +5,7 @@
 <div id="log"></div>
 <script>
 test(function() {
-  assert_throws(new TypeError(), function() {
     postMessage('');
-  });
+    this.done();
 });
 </script>
index 00dbe70d442d55d0ae891552e89f227706aaea02..6b979ab54702635de808eed512588e95c5fee3ef 100755 (executable)
@@ -2,13 +2,18 @@
 <title>origin of the script that invoked the method, data:</title>
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
-<iframe src="data:text/html"></iframe>
+<iframe src="data:text/html,<script>onmessage = function(e) { parent.postMessage(e.origin, '*'); }; parent.postMessage('loaded', '*');</script>"></iframe>
 <div id=log></div>
 <script>
 async_test(function() {
-  window[0].postMessage('', '*');
-  window[0].onmessage = this.step_func(function(e) {
-    assert_equals(e.origin, location.protocol + '//' + location.host);
+  onmessage = this.step_func(function(e) {
+    if (e.data === 'loaded') {
+      window[0].postMessage('', '*');
+      return;
+    }
+
+    assert_equals(e.data, location.protocol + '//' + location.host);
+    assert_equals(e.origin, 'null');
     assert_array_equals(e.ports, []);
     this.done();
   });