diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-09 09:42:44 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-09 09:42:44 +0100 |
commit | a59391482883479a9b28a6f1ace6d1ebd08a7ecd (patch) | |
tree | fa539db054a20a67bff2fc891c33b0f4ec632916 /Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp | |
parent | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (diff) | |
download | qtwebkit-a59391482883479a9b28a6f1ace6d1ebd08a7ecd.tar.gz |
Imported WebKit commit 7bcdfab9a40db7d16b4b95bb77d78b8a59c9e701 (http://svn.webkit.org/repository/webkit/trunk@134025)
New snapshot with numerious build fixes, including MSVC 2012 and ARM Thumb-2.
Diffstat (limited to 'Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp index a2a4f442d..d950c1c74 100644 --- a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp +++ b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp @@ -99,18 +99,34 @@ void checkKeyPathNumberValue(const ScriptValue& value, const String& keyPath, in ASSERT_TRUE(expected == idbKey->number()); } -static v8::Handle<v8::Context> context() -{ - static WebView* webView; - if (!webView) { - webView = FrameTestHelpers::createWebViewAndLoad("about:blank"); - webView->setFocus(true); +class IDBKeyFromValueAndKeyPathTest : public testing::Test { +public: + IDBKeyFromValueAndKeyPathTest() + : m_webView(0) + { + } + + void SetUp() OVERRIDE + { + m_webView = FrameTestHelpers::createWebViewAndLoad("about:blank"); + m_webView->setFocus(true); + } + + void TearDown() OVERRIDE + { + m_webView->close(); + } + + v8::Handle<v8::Context> context() + { + return static_cast<WebFrameImpl*>(m_webView->mainFrame())->frame()->script()->mainWorldContext(); } - ScriptExecutionContext* context = static_cast<WebFrameImpl*>(webView->mainFrame())->frame()->document(); - return toV8Context(context, WorldContextHandle(UseCurrentWorld)); -} -TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) +private: + WebView* m_webView; +}; + +TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) { v8::HandleScope handleScope; v8::Context::Scope scope(context()); @@ -124,7 +140,7 @@ TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) checkKeyPathNullValue(scriptValue, "bar"); } -TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) +TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) { v8::HandleScope handleScope; v8::Context::Scope scope(context()); @@ -138,7 +154,7 @@ TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) checkKeyPathNullValue(scriptValue, "bar"); } -TEST(IDBKeyFromValueAndKeyPathTest, SubProperty) +TEST_F(IDBKeyFromValueAndKeyPathTest, SubProperty) { v8::HandleScope handleScope; v8::Context::Scope scope(context()); @@ -154,7 +170,10 @@ TEST(IDBKeyFromValueAndKeyPathTest, SubProperty) checkKeyPathNullValue(scriptValue, "bar"); } -TEST(InjectIDBKeyTest, TopLevelPropertyStringValue) +class InjectIDBKeyTest : public IDBKeyFromValueAndKeyPathTest { +}; + +TEST_F(InjectIDBKeyTest, TopLevelPropertyStringValue) { v8::HandleScope handleScope; v8::Context::Scope scope(context()); @@ -169,7 +188,7 @@ TEST(InjectIDBKeyTest, TopLevelPropertyStringValue) checkInjectionFails(IDBKey::createString("key"), foozoo, "foo.bar"); } -TEST(InjectIDBKeyTest, SubProperty) +TEST_F(InjectIDBKeyTest, SubProperty) { v8::HandleScope handleScope; v8::Context::Scope scope(context()); |