OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "mojo/public/cpp/bindings/binding.h" | 7 #include "mojo/public/cpp/bindings/binding.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/mojo/url_test.mojom-blink.h" | 9 #include "url/mojo/url_test.mojom-blink.h" |
10 #include "url/url_constants.h" | 10 #include "url/url_constants.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 mojo::Binding<UrlTest> m_binding; | 31 mojo::Binding<UrlTest> m_binding; |
32 }; | 32 }; |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 // Mojo version of chrome IPC test in url/ipc/url_param_traits_unittest.cc. | 36 // Mojo version of chrome IPC test in url/ipc/url_param_traits_unittest.cc. |
37 TEST(KURLSecurityOriginStructTraitsTest, Basic) { | 37 TEST(KURLSecurityOriginStructTraitsTest, Basic) { |
38 base::MessageLoop messageLoop; | 38 base::MessageLoop messageLoop; |
39 | 39 |
40 url::mojom::blink::UrlTestPtr proxy; | 40 url::mojom::blink::UrlTestPtr proxy; |
41 UrlTestImpl impl(GetProxy(&proxy)); | 41 UrlTestImpl impl(MakeRequest(&proxy)); |
42 | 42 |
43 const char* serializeCases[] = { | 43 const char* serializeCases[] = { |
44 "http://www.google.com/", "http://user:pass@host.com:888/foo;bar?baz#nop", | 44 "http://www.google.com/", "http://user:pass@host.com:888/foo;bar?baz#nop", |
45 }; | 45 }; |
46 | 46 |
47 for (const char* testCase : serializeCases) { | 47 for (const char* testCase : serializeCases) { |
48 KURL input(KURL(), testCase); | 48 KURL input(KURL(), testCase); |
49 KURL output; | 49 KURL output; |
50 EXPECT_TRUE(proxy->BounceUrl(input, &output)); | 50 EXPECT_TRUE(proxy->BounceUrl(input, &output)); |
51 | 51 |
(...skipping 28 matching lines...) Expand all Loading... |
80 EXPECT_TRUE(proxy->BounceOrigin(nonUnique, &output)); | 80 EXPECT_TRUE(proxy->BounceOrigin(nonUnique, &output)); |
81 EXPECT_TRUE(nonUnique->isSameSchemeHostPort(output.get())); | 81 EXPECT_TRUE(nonUnique->isSameSchemeHostPort(output.get())); |
82 EXPECT_FALSE(nonUnique->isUnique()); | 82 EXPECT_FALSE(nonUnique->isUnique()); |
83 | 83 |
84 RefPtr<SecurityOrigin> unique = SecurityOrigin::createUnique(); | 84 RefPtr<SecurityOrigin> unique = SecurityOrigin::createUnique(); |
85 EXPECT_TRUE(proxy->BounceOrigin(unique, &output)); | 85 EXPECT_TRUE(proxy->BounceOrigin(unique, &output)); |
86 EXPECT_TRUE(output->isUnique()); | 86 EXPECT_TRUE(output->isUnique()); |
87 } | 87 } |
88 | 88 |
89 } // namespace url | 89 } // namespace url |
OLD | NEW |