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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/streams/resources/test-utils.js

Issue 2502433002: Import wpt@8dc7bfef80f5df47e14509d1496bdbc5ec24c91c (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 years, 1 month 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
OLDNEW
(Empty)
1 'use strict';
2
3 self.getterRejects = (t, obj, getterName, target) => {
4 const getter = Object.getOwnPropertyDescriptor(obj, getterName).get;
5
6 return promise_rejects(t, new TypeError(), getter.call(target));
7 };
8
9 self.methodRejects = (t, obj, methodName, target) => {
10 const method = obj[methodName];
11
12 return promise_rejects(t, new TypeError(), method.call(target));
13 };
14
15 self.getterThrows = (obj, getterName, target) => {
16 const getter = Object.getOwnPropertyDescriptor(obj, getterName).get;
17
18 assert_throws(new TypeError(), () => getter.call(target), getterName + ' shoul d throw a TypeError');
19 };
20
21 self.methodThrows = (obj, methodName, target, args) => {
22 const method = obj[methodName];
23
24 assert_throws(new TypeError(), () => method.apply(target, args), methodName + ' should throw a TypeError');
25 };
26
27 self.garbageCollect = () => {
28 if (self.gc) {
29 // Use --expose_gc for V8 (and Node.js)
30 // Exposed in SpiderMonkey shell as well
31 self.gc();
32 } else if (self.GCController) {
33 // Present in some WebKit development environments
34 GCController.collect();
35 } else {
36 /* eslint-disable no-console */
37 console.warn('Tests are running without the ability to do manual garbage col lection. They will still work, but ' +
38 'coverage will be suboptimal.');
39 /* eslint-enable no-console */
40 }
41 };
42
43 self.delay = ms => new Promise(resolve => step_timeout(resolve, ms));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698