+2007-10-29 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add a globalFlag property to the LayoutTestController to allow cross-domain indications.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (getGlobalFlagCallback):
+ (setGlobalFlagCallback):
+ (LayoutTestController::getJSClass):
+ (LayoutTestController::staticValues):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::globalFlag):
+ (LayoutTestController::setGlobalFlag):
+
2007-10-29 Darin Adler <darin@apple.com>
Reviewed by Maciej.
, m_testRepaintSweepHorizontally(testRepaintSweepHorizontallyDefault)
, m_waitToDump(false)
, m_windowIsKey(true)
+ , m_globalFlag(false)
{
}
return JSValueMakeNumber(context, windows);
}
+// Static Values
+
+static JSValueRef getGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+ LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return JSValueMakeBoolean(context, controller->globalFlag());
+}
+
+static bool setGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
+{
+ LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setGlobalFlag(JSValueToBoolean(context, value));
+ return true;
+}
+
// Object Creation
void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
JSClassRef LayoutTestController::getJSClass()
{
- static JSClassRef layoutTestControllerClass = 0;
+ static JSClassRef layoutTestControllerClass;
if (!layoutTestControllerClass) {
+ JSStaticValue* staticValues = LayoutTestController::staticValues();
JSStaticFunction* staticFunctions = LayoutTestController::staticFunctions();
JSClassDefinition classDefinition = {
- 0, kJSClassAttributeNone, "LayoutTestController", 0, 0, staticFunctions,
+ 0, kJSClassAttributeNone, "LayoutTestController", 0, staticValues, staticFunctions,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
return layoutTestControllerClass;
}
+JSStaticValue* LayoutTestController::staticValues()
+{
+ static JSStaticValue staticValues[] = {
+ { "globalFlag", getGlobalFlagCallback, setGlobalFlagCallback, kJSPropertyAttributeNone },
+ { 0, 0, 0, 0 }
+ };
+ return staticValues;
+
+}
+
JSStaticFunction* LayoutTestController::staticFunctions()
{
static JSStaticFunction staticFunctions[] = {
return staticFunctions;
}
+
+
bool windowIsKey() const { return m_windowIsKey; }
void setWindowIsKey(bool windowIsKey);
+ bool globalFlag() const { return m_globalFlag; }
+ void setGlobalFlag(bool globalFlag) { m_globalFlag = globalFlag; }
+
private:
bool m_dumpAsText;
bool m_dumpBackForwardList;
bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
bool m_windowIsKey;
+ bool m_globalFlag;
+
static JSClassRef getJSClass();
+ static JSStaticValue* staticValues();
static JSStaticFunction* staticFunctions();
};