diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-15 09:40:09 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-15 09:40:09 +0000 |
commit | f69ae902bf6a334736a09e6ad278a6b63f4cb704 (patch) | |
tree | 5a48e50f864b5681c847d6cc027b38ec3c67e618 /chrome/test/v8_unit_test.h | |
parent | 7148b5906bc2231f7160a19cac039e8279b0eace (diff) | |
download | chromium_src-f69ae902bf6a334736a09e6ad278a6b63f4cb704.zip chromium_src-f69ae902bf6a334736a09e6ad278a6b63f4cb704.tar.gz chromium_src-f69ae902bf6a334736a09e6ad278a6b63f4cb704.tar.bz2 |
Revert "Commit issue 19737: Partial implementation of tests for Greasemonkey"
This reverts commit 5baa51ba4f89005c2bc96f25d446fc638f231af0.
Review URL: http://codereview.chromium.org/21386
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9842 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/v8_unit_test.h')
-rw-r--r-- | chrome/test/v8_unit_test.h | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/chrome/test/v8_unit_test.h b/chrome/test/v8_unit_test.h deleted file mode 100644 index 5b4c4ce..0000000 --- a/chrome/test/v8_unit_test.h +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_TEST_V8_UNIT_TEST_H_ -#define CHROME_TEST_V8_UNIT_TEST_H_ - -#include <string> - -#include "base/string_piece.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "v8/include/v8.h" - -// A superclass for unit tests that involve running JavaeScript. This class -// sets up V8 context and has methods that make it easy to execute scripts in -// this context as well as call functions in the context. -class V8UnitTest : public testing::Test { - public: - V8UnitTest() {} - virtual void SetUp(); - - protected: - // Executes the given script source in the context. The specified script - // name is used when reporting errors. - virtual void ExecuteScriptInContext(const StringPiece& script_source, - const StringPiece& script_name); - - // Converts a v8::TryCatch into a human readable string. - virtual std::string ExceptionToString(v8::TryCatch* try_catch); - - // Calls the specified function that resides in the global scope of the - // context. If the function throws an exception, FAIL() is called to - // indicate a unit test failure. This is useful for executing unit test - // functions implemented in JavaScript. - virtual void TestFunction(const std::string& function_name); - - // This method is bound to a global function "log" in the context. - // Scripts running in the context can call this to print out logging - // information to the console. - static v8::Handle<v8::Value> Log(const v8::Arguments& args); - - // Handle scope that is used throughout the life of this class. - v8::HandleScope handle_scope_; - - // Context for the JavaScript in the test. - v8::Handle<v8::Context> context_; -}; - -#endif // CHROME_TEST_V8_UNIT_TEST_H_ - -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_TEST_V8_UNIT_TEST_H_ -#define CHROME_TEST_V8_UNIT_TEST_H_ - -#include <string> - -#include "base/string_piece.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "v8/include/v8.h" - -// A superclass for unit tests that involve running JavaeScript. This class -// sets up V8 context and has methods that make it easy to execute scripts in -// this context as well as call functions in the context. -class V8UnitTest : public testing::Test { - public: - V8UnitTest() {} - virtual void SetUp(); - - protected: - // Executes the given script source in the context. The specified script - // name is used when reporting errors. - virtual void ExecuteScriptInContext(const StringPiece& script_source, - const StringPiece& script_name); - - // Converts a v8::TryCatch into a human readable string. - virtual std::string ExceptionToString(v8::TryCatch* try_catch); - - // Calls the specified function that resides in the global scope of the - // context. If the function throws an exception, FAIL() is called to - // indicate a unit test failure. This is useful for executing unit test - // functions implemented in JavaScript. - virtual void TestFunction(const std::string& function_name); - - // This method is bound to a global function "log" in the context. - // Scripts running in the context can call this to print out logging - // information to the console. - static v8::Handle<v8::Value> Log(const v8::Arguments& args); - - // Handle scope that is used throughout the life of this class. - v8::HandleScope handle_scope_; - - // Context for the JavaScript in the test. - v8::Handle<v8::Context> context_; -}; - -#endif // CHROME_TEST_V8_UNIT_TEST_H_ - |