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

Unified Diff: test/JsEngine.cpp

Issue 10727002: Get rid of dependencies on v8.h in public header files (Closed)
Patch Set: Added helper class to make using v8 values via auto_ptr less awkward Created May 23, 2013, 4:08 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
« include/AdblockPlus/V8ValueHolder.h ('K') | « src/WebRequestJsObject.cpp ('k') | no next file » | 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
@@ -10,16 +10,17 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdexcept>
#include "BaseJsTest.h"
namespace
{
class JsEngineTest : public BaseJsTest
{
};
@@ -35,22 +36,22 @@ TEST_F(JsEngineTest, Evaluate)
jsEngine->Evaluate("function hello() { return 'Hello'; }");
AdblockPlus::JsValuePtr result = jsEngine->Evaluate("hello()");
ASSERT_TRUE(result->IsString());
ASSERT_EQ("Hello", result->AsString());
}
TEST_F(JsEngineTest, RuntimeExceptionIsThrown)
{
- ASSERT_THROW(jsEngine->Evaluate("doesnotexist()"), AdblockPlus::JsError);
+ ASSERT_THROW(jsEngine->Evaluate("doesnotexist()"), std::runtime_error);
}
TEST_F(JsEngineTest, CompileTimeExceptionIsThrown)
{
- ASSERT_THROW(jsEngine->Evaluate("'foo'bar'"), AdblockPlus::JsError);
+ ASSERT_THROW(jsEngine->Evaluate("'foo'bar'"), std::runtime_error);
}
TEST_F(JsEngineTest, ValueCreation)
{
AdblockPlus::JsValuePtr value;
value = jsEngine->NewValue("foo");
ASSERT_TRUE(value->IsString());
« include/AdblockPlus/V8ValueHolder.h ('K') | « src/WebRequestJsObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld