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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp

Issue 2927503002: [Presentation API / Media Router] Relax PresentationRequest URL check. (Closed)
Patch Set: Really add #include Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp
index 6f06c5e08af837011a6aaacb88c1f44de6857b3d..516b591cb5d34bf6bd448f9e30deae6e73428d2a 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp
@@ -43,29 +43,31 @@ TEST(PresentationRequestTest, TestMultipleUrlConstructor) {
EXPECT_EQ("cast://deadbeef?param=foo", request_urls[1].GetString());
}
-TEST(PresentationRequestTest, TestMultipleUrlConstructorInvalidURLFamily) {
+TEST(PresentationRequestTest, TestMultipleUrlConstructorInvalidUrl) {
V8TestingScope scope;
WTF::Vector<String> urls;
urls.push_back("https://example.com");
- urls.push_back("about://deadbeef?param=foo");
+ urls.push_back("");
PresentationRequest::Create(scope.GetExecutionContext(), urls,
scope.GetExceptionState());
- ASSERT_TRUE(scope.GetExceptionState().HadException());
-
+ EXPECT_TRUE(scope.GetExceptionState().HadException());
EXPECT_EQ(kSyntaxError, scope.GetExceptionState().Code());
}
-TEST(PresentationRequestTest, TestMultipleUrlConstructorInvalidUrl) {
+TEST(PresentationRequestTest, TestMixedContentNotCheckedForNonHttpFamily) {
V8TestingScope scope;
- WTF::Vector<String> urls;
- urls.push_back("https://example.com");
- urls.push_back("");
+ scope.GetExecutionContext()->GetSecurityContext().SetSecurityOrigin(
+ SecurityOrigin::CreateFromString("https://example.test"));
- PresentationRequest::Create(scope.GetExecutionContext(), urls,
- scope.GetExceptionState());
- EXPECT_TRUE(scope.GetExceptionState().HadException());
- EXPECT_EQ(kSyntaxError, scope.GetExceptionState().Code());
+ PresentationRequest* request = PresentationRequest::Create(
+ scope.GetExecutionContext(), "foo://bar", scope.GetExceptionState());
+ ASSERT_FALSE(scope.GetExceptionState().HadException());
+
+ WTF::Vector<KURL> request_urls = request->Urls();
+ EXPECT_EQ(static_cast<size_t>(1), request_urls.size());
+ EXPECT_TRUE(request_urls[0].IsValid());
+ EXPECT_EQ("foo://bar", request_urls[0].GetString());
}
TEST(PresentationRequestTest, TestSingleUrlConstructorMixedContent) {
« no previous file with comments | « third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698