OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/tests/test_url_util.h" | 5 #include "ppapi/tests/test_url_util.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_url_util_dev.h" | 7 #include "ppapi/c/dev/ppb_url_util_dev.h" |
8 #include "ppapi/cpp/dev/url_util_dev.h" | 8 #include "ppapi/cpp/dev/url_util_dev.h" |
9 #include "ppapi/tests/testing_instance.h" | 9 #include "ppapi/tests/testing_instance.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 void TestURLUtil::RunTests(const std::string& filter) { | 23 void TestURLUtil::RunTests(const std::string& filter) { |
24 RUN_TEST(Canonicalize, filter); | 24 RUN_TEST(Canonicalize, filter); |
25 RUN_TEST(ResolveRelative, filter); | 25 RUN_TEST(ResolveRelative, filter); |
26 RUN_TEST(IsSameSecurityOrigin, filter); | 26 RUN_TEST(IsSameSecurityOrigin, filter); |
27 RUN_TEST(DocumentCanRequest, filter); | 27 RUN_TEST(DocumentCanRequest, filter); |
28 RUN_TEST(DocumentCanAccessDocument, filter); | 28 RUN_TEST(DocumentCanAccessDocument, filter); |
29 RUN_TEST(GetDocumentURL, filter); | 29 RUN_TEST(GetDocumentURL, filter); |
30 RUN_TEST(GetPluginInstanceURL, filter); | 30 RUN_TEST(GetPluginInstanceURL, filter); |
| 31 RUN_TEST(GetPluginRefererURL, filter); |
31 } | 32 } |
32 | 33 |
33 std::string TestURLUtil::TestCanonicalize() { | 34 std::string TestURLUtil::TestCanonicalize() { |
34 // Test no canonicalize output. | 35 // Test no canonicalize output. |
35 pp::Var result = util_->Canonicalize("http://Google.com"); | 36 pp::Var result = util_->Canonicalize("http://Google.com"); |
36 ASSERT_TRUE(result.AsString() == "http://google.com/"); | 37 ASSERT_TRUE(result.AsString() == "http://google.com/"); |
37 | 38 |
38 // Test all the components | 39 // Test all the components |
39 PP_URLComponents_Dev c; | 40 PP_URLComponents_Dev c; |
40 result = util_->Canonicalize( | 41 result = util_->Canonicalize( |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 PASS(); | 130 PASS(); |
130 } | 131 } |
131 | 132 |
132 std::string TestURLUtil::TestGetPluginInstanceURL() { | 133 std::string TestURLUtil::TestGetPluginInstanceURL() { |
133 pp::Var url = util_->GetPluginInstanceURL(instance_); | 134 pp::Var url = util_->GetPluginInstanceURL(instance_); |
134 ASSERT_TRUE(url.is_string()); | 135 ASSERT_TRUE(url.is_string()); |
135 // see test_case.html | 136 // see test_case.html |
136 ASSERT_EQ(url.AsString(), "http://a.b.c/test"); | 137 ASSERT_EQ(url.AsString(), "http://a.b.c/test"); |
137 PASS(); | 138 PASS(); |
138 } | 139 } |
| 140 |
| 141 std::string TestURLUtil::TestGetPluginRefererURL() { |
| 142 pp::Var url = util_->GetPluginRefererURL(instance_); |
| 143 ASSERT_TRUE(url.is_undefined()); |
| 144 PASS(); |
| 145 } |
OLD | NEW |