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

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

Issue 2566503002: Adds HTTP check to PresentationRequest creation. (Closed)
Patch Set: Adds unittest Created 3 years, 11 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 f76d06334b6c63a755957b2edcc4bc7020afeb6e..9b3d7cb5487f0385fd2d726d6d3e0295db28dfa3 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp
@@ -29,7 +29,7 @@ TEST(PresentationRequestTest, TestMultipleUrlConstructor) {
V8TestingScope scope;
WTF::Vector<String> urls;
urls.append("https://example.com");
- urls.append("cast://deadbeef?param=foo");
+ urls.append("http://deadbeef?param=foo");
PresentationRequest* request = PresentationRequest::create(
scope.getExecutionContext(), urls, scope.getExceptionState());
@@ -40,7 +40,20 @@ TEST(PresentationRequestTest, TestMultipleUrlConstructor) {
EXPECT_TRUE(requestUrls[0].isValid());
EXPECT_EQ("https://example.com/", requestUrls[0].getString());
EXPECT_TRUE(requestUrls[1].isValid());
- EXPECT_EQ("cast://deadbeef?param=foo", requestUrls[1].getString());
+ EXPECT_EQ("http://deadbeef/?param=foo", requestUrls[1].getString());
+}
+
+TEST(PresentationRequestTest, TestMultipleUrlConstructorInvalidURLFamily) {
+ V8TestingScope scope;
+ WTF::Vector<String> urls;
+ urls.append("https://example.com");
+ urls.append("cast://deadbeef?param=foo");
zhaobin 2017/01/18 18:58:22 Some layout tests uses url with "cast://". They ma
mark a. foltz 2017/01/18 20:26:01 Yeah, now that we have tests for cast:// we should
+
+ PresentationRequest::create(scope.getExecutionContext(), urls,
+ scope.getExceptionState());
+ ASSERT_TRUE(scope.getExceptionState().hadException());
+
+ EXPECT_EQ(SyntaxError, scope.getExceptionState().code());
}
TEST(PresentationRequestTest, TestMultipleUrlConstructorInvalidUrl) {
« 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