Browse Source

chore: run protocol tests in separate WebContents (#18202)

Cheng Zhao 6 years ago
parent
commit
8de9ba6df6
2 changed files with 230 additions and 543 deletions
  1. 215 543
      spec/api-protocol-spec.js
  2. 15 0
      spec/fixtures/pages/jquery.html

File diff suppressed because it is too large
+ 215 - 543
spec/api-protocol-spec.js


+ 15 - 0
spec/fixtures/pages/jquery.html

@@ -3,5 +3,20 @@
   <script src="../../static/jquery-2.0.3.min.js"></script>
 </head>
 <body>
+<script>
+  window.ajax = (url, options) => {
+    return new Promise((resolve, reject) => {
+      options.url = url
+      options.cache = false
+      options.success = (data, status, request) => {
+        resolve({data, status: request.status, headers: request.getAllResponseHeaders()})
+      }
+      options.error = (xhr, errorType, error) => {
+        reject(error ? error : xhr.status)
+      }
+      $.ajax(options)
+    })
+  }
+</script>
 </body>
 </html>

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