Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp

Issue 11337028: Merge 132922 - Remove ensureAuxiliaryContext (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebKit/chromium/WebKit.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp (revision 132933)
+++ Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp (working copy)
@@ -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 @@
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, 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, 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(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, 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();
« no previous file with comments | « Source/WebKit/chromium/WebKit.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698