diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
commit | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch) | |
tree | 24d68c6f61c464ecba1e05670b80390ea3b0e50c /Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp | |
parent | 69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff) | |
download | qtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz |
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp index 46710e745..a2a4f442d 100644 --- a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp +++ b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp @@ -24,11 +24,19 @@ */ #include "config.h" +#include "Document.h" +#include "Frame.h" +#include "FrameTestHelpers.h" #include "IDBBindingUtilities.h" #include "IDBKey.h" #include "IDBKeyPath.h" +#include "V8Binding.h" #include "V8PerIsolateData.h" #include "V8Utilities.h" +#include "WebFrame.h" +#include "WebFrameImpl.h" +#include "WebView.h" +#include "WorldContextHandle.h" #include <gtest/gtest.h> #include <wtf/Vector.h> @@ -36,6 +44,7 @@ #if ENABLE(INDEXED_DATABASE) using namespace WebCore; +using namespace WebKit; namespace { @@ -90,10 +99,21 @@ 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); + } + ScriptExecutionContext* context = static_cast<WebFrameImpl*>(webView->mainFrame())->frame()->document(); + return toV8Context(context, WorldContextHandle(UseCurrentWorld)); +} + TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) { v8::HandleScope handleScope; - v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); + v8::Context::Scope scope(context()); v8::Local<v8::Object> object = v8::Object::New(); object->Set(v8::String::New("foo"), v8::String::New("zoo")); @@ -107,7 +127,7 @@ TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) { v8::HandleScope handleScope; - v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); + v8::Context::Scope scope(context()); v8::Local<v8::Object> object = v8::Object::New(); object->Set(v8::String::New("foo"), v8::Number::New(456)); @@ -121,7 +141,7 @@ TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) TEST(IDBKeyFromValueAndKeyPathTest, SubProperty) { v8::HandleScope handleScope; - v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); + v8::Context::Scope scope(context()); v8::Local<v8::Object> object = v8::Object::New(); v8::Local<v8::Object> subProperty = v8::Object::New(); @@ -137,7 +157,7 @@ TEST(IDBKeyFromValueAndKeyPathTest, SubProperty) TEST(InjectIDBKeyTest, TopLevelPropertyStringValue) { v8::HandleScope handleScope; - v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); + v8::Context::Scope scope(context()); v8::Local<v8::Object> object = v8::Object::New(); object->Set(v8::String::New("foo"), v8::String::New("zoo")); @@ -152,7 +172,7 @@ TEST(InjectIDBKeyTest, TopLevelPropertyStringValue) TEST(InjectIDBKeyTest, SubProperty) { v8::HandleScope handleScope; - v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); + v8::Context::Scope scope(context()); v8::Local<v8::Object> object = v8::Object::New(); v8::Local<v8::Object> subProperty = v8::Object::New(); |