Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/JsEngine.cpp

Issue 10259001: XMLHttpRequest API (Closed)
Patch Set: Addressed review comments Created April 11, 2013, 4:30 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/GlobalJsObject.cpp ('k') | test/WebRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/JsEngine.cpp
===================================================================
--- a/test/JsEngine.cpp
+++ b/test/JsEngine.cpp
@@ -42,48 +42,48 @@ public:
return std::auto_ptr<std::istream>(file);
}
};
TEST(JsEngineTest, EvaluateAndCall)
{
ThrowingFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
const std::string source = "function hello() { return 'Hello'; }";
jsEngine.Evaluate(source);
const std::string result = jsEngine.Call("hello");
ASSERT_EQ("Hello", result);
}
TEST(JsEngineTest, LoadAndCall)
{
StubFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
jsEngine.Load("hello.js");
const std::string result = jsEngine.Call("hello");
ASSERT_EQ("Hello", result);
}
TEST(JsEngineTest, LoadBadStreamFails)
{
BadFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
ASSERT_ANY_THROW(jsEngine.Load("hello.js"));
}
TEST(JsEngineTest, RuntimeExceptionIsThrown)
{
ThrowingFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
ASSERT_THROW(jsEngine.Evaluate("doesnotexist()"), AdblockPlus::JsError);
}
TEST(JsEngineTest, CompileTimeExceptionIsThrown)
{
ThrowingFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
ASSERT_THROW(jsEngine.Evaluate("'foo'bar'"), AdblockPlus::JsError);
}
« no previous file with comments | « test/GlobalJsObject.cpp ('k') | test/WebRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld