Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / network / request-name-path.html
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script>
5 function test()
6 {
7     function createNetworkRequestForURLAndDumpNameAndPath(url)
8     {
9         InspectorTest.addResult("Dumping request name and path for url: " + url);
10         var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), 0, url);
11         InspectorTest.addResult("    name = " + request.name());
12         InspectorTest.addResult("    path = " + request.path());
13     }
14
15     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/foo/bar/baz?key=value");
16     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/foo/bar/?key=value");
17     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/foo/bar/baz");
18     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/foo/bar/");
19
20     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/baz?key=value");
21     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/?key=value");
22     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/baz");
23     createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/");
24
25     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/foo/bar/baz?key=value");
26     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/foo/bar/?key=value");
27     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/foo/bar/baz");
28     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/foo/bar/");
29
30     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/baz?key=value");
31     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/?key=value");
32     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/baz");
33     createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/");
34
35     InspectorTest.completeTest();
36 }
37
38 </script>
39 </head>
40 <body onload="runTest()">
41 <p>Tests name() and path() methods of NetworkRequest.</p>
42 <a href="https://bugs.webkit.org/show_bug.cgi?id=101064">Bug 101064</a>
43 </body>
44 </html>