Browse Source

Refactor <webview> tag tests (#12886)

Alexey Kuzmin 7 years ago
parent
commit
fc34076c2b

+ 7 - 1
spec/fixtures/module/preload-node-off.js

@@ -1,6 +1,12 @@
 setImmediate(function () {
   try {
-    console.log([typeof process, typeof setImmediate, typeof global, typeof Buffer].join(' '))
+    const types = {
+      process: typeof process,
+      setImmediate: typeof setImmediate,
+      global: typeof global,
+      Buffer: typeof Buffer
+    }
+    console.log(JSON.stringify(types))
   } catch (e) {
     console.log(e.message)
   }

+ 8 - 1
spec/fixtures/module/preload-required-module.js

@@ -1,5 +1,12 @@
 try {
-  console.log([typeof process, typeof setImmediate, typeof global, typeof Buffer, typeof global.Buffer].join(' '))
+  const types = {
+    process: typeof process,
+    setImmediate: typeof setImmediate,
+    global: typeof global,
+    Buffer: typeof Buffer,
+    'global.Buffer': typeof global.Buffer
+  }
+  console.log(JSON.stringify(types))
 } catch (e) {
   console.log(e.message)
 }

+ 7 - 1
spec/fixtures/module/preload.js

@@ -1 +1,7 @@
-console.log([typeof require, typeof module, typeof process, typeof Buffer].join(' '))
+const types = {
+  require: typeof require,
+  module: typeof module,
+  process: typeof process,
+  Buffer: typeof Buffer
+}
+console.log(JSON.stringify(types))

+ 7 - 1
spec/fixtures/pages/c.html

@@ -1,7 +1,13 @@
 <html>
 <body>
 <script type="text/javascript" charset="utf-8">
-  console.log([typeof require, typeof module, typeof process, typeof global].join(' '));
+  const types = {
+    require: typeof require,
+    module: typeof module,
+    process: typeof process,
+    global: typeof global
+  }
+  console.log(JSON.stringify(types));
 </script>
 </body>
 </html>

+ 6 - 1
spec/fixtures/pages/d.html

@@ -1,7 +1,12 @@
 <html>
 <body>
 <script type="text/javascript" charset="utf-8">
-  console.log([typeof require, typeof module, typeof process].join(' '));
+  const types = {
+    require: typeof require,
+    module: typeof module,
+    process: typeof process
+  }
+  console.log(JSON.stringify(types));
 </script>
 </body>
 </html>

+ 4 - 2
spec/fixtures/pages/partition/one.html

@@ -1,4 +1,6 @@
 <script>
-const item = window.localStorage.getItem('test');
-console.log([item, window.localStorage.length].join(' '));
+console.log(JSON.stringify({
+  numberOfEntries: window.localStorage.length,
+  testValue: window.localStorage.getItem('test')
+}));
 </script>

File diff suppressed because it is too large
+ 386 - 411
spec/webview-spec.js


Some files were not shown because too many files changed in this diff