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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/DocumentWriteEvaluatorTest.cpp

Issue 2180663002: Replace compileAndRunInternalScript with not internal in DocumentWriteEvaluator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: third_party/WebKit/Source/bindings/core/v8/DocumentWriteEvaluatorTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/DocumentWriteEvaluatorTest.cpp b/third_party/WebKit/Source/bindings/core/v8/DocumentWriteEvaluatorTest.cpp
index 882354c408fb72a3cb852665c9c0152c0d3ac218..1bba8f1d7b61967d303c5e6ccab4c797da4f505a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/DocumentWriteEvaluatorTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/DocumentWriteEvaluatorTest.cpp
@@ -26,14 +26,14 @@ public:
TEST_F(DocumentWriteEvaluatorTest, NoEvaluation)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
- "var a = 2;");
+ "var a = 2;", nullptr);
EXPECT_EQ("", written);
}
TEST_F(DocumentWriteEvaluatorTest, SimpleDocumentWrite)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
- "document.write('Hello, World!');");
+ "document.write('Hello, World!');", nullptr);
EXPECT_EQ("Hello, World!", written);
}
@@ -41,7 +41,8 @@ TEST_F(DocumentWriteEvaluatorTest, WriteBeforeError)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
"document.write('Hello, World!');"
- "console.log('this causes an exception');");
+ "console.log('this causes an exception');",
+ nullptr);
EXPECT_EQ("Hello, World!", written);
}
@@ -50,7 +51,8 @@ TEST_F(DocumentWriteEvaluatorTest, MultipleWrites)
String written = m_evaluator->evaluateAndEmitWrittenSource(
"document.write('Hello, World', '!');"
"window.document.write('How' + ' are you?');"
- "document.writeln('Not bad.');");
+ "document.writeln('Not bad.');",
+ nullptr);
EXPECT_EQ("Hello, World!How are you?Not bad.", written);
}
@@ -59,7 +61,8 @@ TEST_F(DocumentWriteEvaluatorTest, HandleSimpleFunctions)
String written = m_evaluator->evaluateAndEmitWrittenSource(
"(function(src) {"
"document.write(src);"
- "})('Hello, World!');");
+ "})('Hello, World!');",
+ nullptr);
EXPECT_EQ("Hello, World!", written);
}
@@ -69,7 +72,8 @@ TEST_F(DocumentWriteEvaluatorTest, DynamicDocWrite)
"var write = document.write;"
"(function(f, w) {"
"f(w);"
- "})(write, 'Hello, World!');");
+ "})(write, 'Hello, World!');",
+ nullptr);
EXPECT_EQ("Hello, World!", written);
}
@@ -77,11 +81,12 @@ TEST_F(DocumentWriteEvaluatorTest, MultipleScripts)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
"var write = document.write;"
- "write('Hello');");
+ "write('Hello');",
+ nullptr);
EXPECT_EQ("Hello", written);
String written2 = m_evaluator->evaluateAndEmitWrittenSource(
- "write('Hello');");
+ "write('Hello');", nullptr);
EXPECT_EQ("Hello", written2);
}
@@ -89,7 +94,8 @@ TEST_F(DocumentWriteEvaluatorTest, UsePath)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
"document.write(location.pathname);"
- "document.write(' ', window.location.pathname);");
+ "document.write(' ', window.location.pathname);",
+ nullptr);
EXPECT_EQ("/path/ /path/", written);
}
@@ -97,7 +103,8 @@ TEST_F(DocumentWriteEvaluatorTest, UseHost)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
"document.write(location.hostname);"
- "document.write(' ', window.location.hostname);");
+ "document.write(' ', window.location.hostname);",
+ nullptr);
EXPECT_EQ("www.example.com www.example.com", written);
}
@@ -105,7 +112,8 @@ TEST_F(DocumentWriteEvaluatorTest, UseProtocol)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
"document.write(location.protocol);"
- "document.write(' ', window.location.protocol);");
+ "document.write(' ', window.location.protocol);",
+ nullptr);
EXPECT_EQ("http: http:", written);
}
@@ -113,7 +121,8 @@ TEST_F(DocumentWriteEvaluatorTest, UseUserAgent)
{
String written = m_evaluator->evaluateAndEmitWrittenSource(
"document.write(navigator.userAgent);"
- "document.write(' ', window.navigator.userAgent);");
+ "document.write(' ', window.navigator.userAgent);",
+ nullptr);
EXPECT_EQ("userAgent userAgent", written);
}

Powered by Google App Engine
This is Rietveld 408576698