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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/product-registry-impl-register-sanity.js

Issue 2875463002: [Devtools] Added sanity check for product registry's register function (Closed)
Patch Set: a Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector-unit/product-registry-impl-register-sanity-expected.txt » ('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
2 TestRunner.loadLazyModules(['product_registry_impl']).then(test);
3 function test() {
4 TestRunner.addResult("This tests product registry impl's register function.");
5
6 resetProductRegistry();
7 ProductRegistryImpl.register([
8 "example.(com|org)",
9 "*.example.com",
10 "test-*.example.com",
11 "subdomain.example.com"
12 ], [
13 {
14 hash: "0caaf24ab1a0c334", // Result of: sha1('example.com').substr(0, 16).
15 prefixes: {
16 "": {
17 product: 0 // Reference to index of first argument of ProductRegistryI mpl.register.
18 },
19 "*": {
20 product: 1
21 },
22 "test-": {
23 product: 2
24 }
25 }
26 },
27 {
28 hash: "20116dfd6774a9e7", // Result of: sha1('example.org').substr(0, 16).
29 prefixes: {
30 "": {
31 product: 0
32 }
33 }
34 },
35 {
36 hash: "e3d90251f85e2064", // Result of: sha1('subdomain.example.com').subs tr(0, 16).
37 prefixes: {
38 "": {
39 product: 3
40 }
41 }
42 }
43 ]);
44 var instance = new ProductRegistryImpl.Registry();
45
46 logDomainEntry('example.com');
47 logDomainEntry('wild.example.com');
48 logDomainEntry('test-1.example.com');
49 logDomainEntry('subdomain.example.com');
50 logDomainEntry('example.org');
51 logDomainEntry('chromium.org');
52
53 TestRunner.completeTest();
54
55 function logDomainEntry(domainStr) {
56 TestRunner.addResult("Testing: " + domainStr + " -> " + instance.nameForUrl( ('http://' + domainStr).asParsedURL()));
57 }
58
59 function resetProductRegistry() {
60 TestRunner.addResult("Cleared ProductRegistryImpl");
61 ProductRegistryImpl._productsByDomainHash.clear();
62 }
63 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector-unit/product-registry-impl-register-sanity-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698