Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: LayoutTests/http/tests/fetch/script-tests/simple.js

Issue 806513004: Add a simple fetch API test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/fetch/resources/hello.txt ('k') | LayoutTests/http/tests/fetch/simple.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/fetch/script-tests/simple.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/simple.js b/LayoutTests/http/tests/fetch/script-tests/simple.js
new file mode 100644
index 0000000000000000000000000000000000000000..76652f660d33a500922bcea597df6595e53f4e43
--- /dev/null
+++ b/LayoutTests/http/tests/fetch/script-tests/simple.js
@@ -0,0 +1,16 @@
+var global = this;
+if (global.importScripts) {
+ importScripts('/resources/testharness.js');
+}
+
+promise_test(function(test) {
+ return Promise.resolve().then(function() {
+ return fetch(new Request('/fetch/resources/hello.txt'));
+ }).then(function(res) {
+ return res.text();
+ }).then(function(text) {
+ assert_equals(text, 'hello, world\n', 'response.body');
+ });
+ });
+
+done();
« no previous file with comments | « LayoutTests/http/tests/fetch/resources/hello.txt ('k') | LayoutTests/http/tests/fetch/simple.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698