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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbkeyrange-includes.htm

Issue 1984023002: Move web-platform-tests to wpt (part 1 of 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
(Empty)
1 <!doctype html>
2 <meta charset=utf-8>
3 <title></title>
4 <script src=../../../resources/testharness.js></script>
5 <script src=../../../resources/testharnessreport.js></script>
6 <script>
7
8 test( function() {
9 var closedRange = IDBKeyRange.bound(5, 20);
10 assert_true(!!closedRange.includes, "IDBKeyRange has a .includes");
11 assert_true(closedRange.includes(7), "in range");
12 assert_false(closedRange.includes(1), "below range");
13 assert_false(closedRange.includes(42), "above range");
14 assert_true(closedRange.includes(5) && closedRange.includes(20),
15 "boundary points");
16 assert_throws("DataError", function() { closedRange.includes({}) },
17 "invalid key");
18 }, "IDBKeyRange.includes() with a closed range");
19
20 test( function() {
21 var openRange = IDBKeyRange.bound(5, 20, true, true);
22 assert_false(openRange.includes(5) || openRange.includes(20),
23 "boundary points");
24 }, "IDBKeyRange.includes() with an open range");
25
26 test( function() {
27 var range = IDBKeyRange.only(42);
28 assert_true(range.includes(42), "in range");
29 assert_false(range.includes(1), "below range");
30 assert_false(range.includes(9000), "above range");
31 }, "IDBKeyRange.includes() with an only range");
32
33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698