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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/worklet/import.html

Issue 1684303002: Add a basic version of Worklet#import. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non-oilpan build. Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/worklet/resources/empty-worklet-script.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9 promise_test(function() {
10
11 return renderWorklet.import('resources/empty-worklet-script.js').then(fu nction(undefined_arg) {
12 assert_equals(undefined_arg, undefined, 'Promise should resolve with no arguments.');
13 }).catch(function(error) {
14 assert_unreached('unexpected rejection: ' + error);
15 });
16
17 }, 'Importing a script resolves the given promise.');
18
19 promise_test(function() {
20
21 return renderWorklet.import('resources/throwing-worklet-script.js').then (function(undefined_arg) {
22 assert_equals(undefined_arg, undefined, 'Promise should resolve with no arguments.');
23 }).catch(function(error) {
24 assert_unreached('unexpected rejection: ' + error);
25 });
26
27 }, 'Importing a script which throws should still resolve the given promise.' );
28
29 promise_test(function() {
30
31 return renderWorklet.import('non-existant-worklet-script.js').then(funct ion() {
32 assert_unreached('import should fail.');
33 }).catch(function(error) {
34 assert_equals(error.name, 'NetworkError', 'error should be a Network Error.');
35 });
36
37 }, 'Importing a non-existant script rejects the given promise with a Network Error.');
38
39 promise_test(function() {
40
41 return renderWorklet.import('http://invalid:123$').then(function() {
42 assert_unreached('import should fail.');
43 }).catch(function(error) {
44 assert_equals(error.name, 'SyntaxError', 'error should be a SyntaxEr ror.');
45 });
46
47 }, 'Attempting to resolve an invalid URL should reject the given promise wit h a SyntaxError.');
48
49 </script>
50 </body>
51 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/worklet/resources/empty-worklet-script.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698