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

Side by Side Diff: LayoutTests/manifest/link-manifest-url.html

Issue 249633002: Detect <link rel='manifest'> and notify embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: error 500 Created 6 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 | Source/core/core.gypi » ('j') | Source/web/FrameLoaderClientImpl.cpp » ('J')
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 <link rel='manifest' href='foo.json'>
5 </head>
6 <body>
7 <script src="../resources/testharness.js"></script>
8 <script src="../resources/testharnessreport.js"></script>
9 <script>
10 var links = document.getElementsByTagName('link');
11
12 test(function() {
13 assert_equals(links[0].href, window.internals.manifestURL(document));
14 }, "Test that the parser correctly find the manifest");
15
16 test(function() {
17 links[0].href = 'foobar.json';
18 assert_equals(links[0].href, window.internals.manifestURL(document));
19 }, "Test that changing the href will change the known URL");
20
21 test(function() {
22 links[0].href = 'htp:/blah';
23 assert_equals(links[0].href, window.internals.manifestURL(document));
24 }, "Test that invalid URL are accepted");
25
26 test(function() {
27 links[0].href = '';
28 assert_equals(links[0].href, window.internals.manifestURL(document));
29 }, "Test that empty URL are accepted");
30
31 test(function() {
32 links[0].href = 'http://example.com/manifest.json';
33 assert_equals(links[0].href, window.internals.manifestURL(document));
34 }, "Test that cross-origin URL are accepted");
35
36 test(function() {
37 links[0].rel = "foo bar manifest";
38 links[0].href = 'http://example.com/manifest.json';
39 assert_equals(links[0].href, window.internals.manifestURL(document));
40 }, "Test that having multiple tokens in @rel will keep thi link as a manifest" );
41
42 test(function() {
43 var link = document.createElement('link');
44 link.rel = 'manifest';
45 link.href = 'foobar.json';
46 document.head.appendChild(link);
47 assert_equals(links[0].href, window.internals.manifestURL(document));
48
49 link = document.createElement('link');
50 link.rel = 'manifest';
51 link.href = 'manifest.json';
52 document.head.insertBefore(link, links[0]);
53 assert_equals(links[0].href, window.internals.manifestURL(document));
54 }, "Test that the first manifest link is being used");
55
56 test(function() {
57 // Remove all current links.
58 while (document.head.firstChild)
59 document.head.removeChild(document.head.firstChild);
60
61 // Add link to the body.
62 var link = document.createElement('link');
63 link.rel = 'manifest';
64 link.href = 'manifest.json';
65 document.body.appendChild(link);
66
67 assert_not_equals(links[0].href, window.internals.manifestURL(document));
68 }, "Test that links outside of the head are ignored");
69
70 </script>
71 </body>
72 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | Source/web/FrameLoaderClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698