summaryrefslogtreecommitdiffstats
path: root/WebKitTools/WebKitTestRunner
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/WebKitTestRunner')
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp13
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h4
2 files changed, 12 insertions, 5 deletions
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index c7f9a84..bf7a029 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -35,6 +35,7 @@
#include <WebKit2/WKBundlePagePrivate.h>
#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WKBundleRange.h>
+#include <WebKit2/WKBundleScriptWorld.h>
using namespace std;
@@ -198,9 +199,9 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKBundlePageRef page, WKStringR
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveTitleForFrame(title, frame);
}
-void InjectedBundlePage::didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window, const void *clientInfo)
+void InjectedBundlePage::didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo)
{
- static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, context, window);
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, world);
}
void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
@@ -412,11 +413,17 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram
InjectedBundle::shared().os() << "TITLE CHANGED: " << title << "\n";
}
-void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window)
+void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world)
{
if (!InjectedBundle::shared().isTestRunning())
return;
+ if (WKBundleScriptWorldNormalWorld() != world)
+ return;
+
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
+ JSObjectRef window = JSContextGetGlobalObject(context);
+
JSValueRef exception = 0;
InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception);
InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception);
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index 3f63bf3..cde1655 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -52,7 +52,7 @@ private:
static void didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, const void*);
- static void didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, JSGlobalContextRef, JSObjectRef window, const void*);
+ static void didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleScriptWorldRef, const void*);
static void didCancelClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef url, double delay, double date, const void*);
static void didChangeLocationWithinPageForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
@@ -67,7 +67,7 @@ private:
void didFinishLoadForFrame(WKBundleFrameRef);
void didFailLoadWithErrorForFrame(WKBundleFrameRef);
void didReceiveTitleForFrame(WKStringRef title, WKBundleFrameRef);
- void didClearWindowForFrame(WKBundleFrameRef, JSGlobalContextRef, JSObjectRef window);
+ void didClearWindowForFrame(WKBundleFrameRef, WKBundleScriptWorldRef);
void didCancelClientRedirectForFrame(WKBundleFrameRef);
void willPerformClientRedirectForFrame(WKBundleFrameRef, WKURLRef url, double delay, double date);
void didChangeLocationWithinPageForFrame(WKBundleFrameRef);