Merge r27238 to fix a hang during the layout tests.

git-svn-id: http://svn.webkit.org/repository/webkit/branches/Safari-3-branch@29111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index fcc91f9..2191ad3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2008-01-02  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Set layoutTestController.globalFlag so tests merged back from trunk, such as
+        those in http/tests/security/frameNavigation, function correctly.
+
+        * http/tests/security/resources/cross-frame-iframe.html:
+
 2007-12-01  Mark Rowe  <mrowe@apple.com>
 
         Merge r28056 to Safari-3-branch.
diff --git a/LayoutTests/http/tests/security/resources/cross-frame-iframe.html b/LayoutTests/http/tests/security/resources/cross-frame-iframe.html
index 2e9518b..09f99f6 100644
--- a/LayoutTests/http/tests/security/resources/cross-frame-iframe.html
+++ b/LayoutTests/http/tests/security/resources/cross-frame-iframe.html
@@ -1,5 +1,14 @@
 <html>
-<body>
+<head>
+    <script>
+        function fireSentinel()
+        {
+            if (window.layoutTestController)
+                layoutTestController.globalFlag = true;
+        }
+    </script>
+</head>
+<body onload="fireSentinel();">
     <p id='accessMe'></p>
     <p>Inner iframe.</p>
     <iframe name='flag'></iframe>
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 325ec28..1ba9922 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,24 +1,44 @@
+2008-01-02  Mark Rowe  <mrowe@apple.com>
+
+        Merge r27238 to fix a hang during the layout tests.
+
+    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-11-30  Adam Roben  <aroben@apple.com>
 
         Merge r26734
 
-        2007-10-17  Adam Roben  <aroben@apple.com>
+    2007-10-17  Adam Roben  <aroben@apple.com>
 
-                Make it possible to have Windows-specific tests and results
+        Make it possible to have Windows-specific tests and results
 
-                When searching for tests to run and the Skipped file, we will only
-                look in platform/win and the cross-platform directory. When looking
-                for expected results, we will look in platform/win, then
-                platform/mac-leopard, then platform/mac, then finally the
-                cross-platform directory.
+        When searching for tests to run and the Skipped file, we will only
+        look in platform/win and the cross-platform directory. When looking
+        for expected results, we will look in platform/win, then
+        platform/mac-leopard, then platform/mac, then finally the
+        cross-platform directory.
 
-                Reviewed by Sam.
+        Reviewed by Sam.
 
-                * Scripts/run-webkit-tests:
-                (sub expectedDirectoryForTest): Search in mac-leopard and mac before
-                searching in the cross-platform directory.
-                (sub buildPlatformHierarchy): Removed some unneeded calls to
-                dirname/basename.
+        * Scripts/run-webkit-tests:
+        (sub expectedDirectoryForTest): Search in mac-leopard and mac before
+        searching in the cross-platform directory.
+        (sub buildPlatformHierarchy): Removed some unneeded calls to
+        dirname/basename.
 
 2007-10-19  Maciej Stachowiak  <mjs@apple.com>
 
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 1764e33..81ac399 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -53,6 +53,7 @@
     , m_testRepaintSweepHorizontally(testRepaintSweepHorizontallyDefault)
     , m_waitToDump(false)
     , m_windowIsKey(true)
+    , m_globalFlag(false)
 {
 }
 
@@ -465,6 +466,21 @@
     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)
@@ -476,12 +492,13 @@
 
 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
         };
 
@@ -491,6 +508,16 @@
     return layoutTestControllerClass;
 }
 
+JSStaticValue* LayoutTestController::staticValues()
+{
+    static JSStaticValue staticValues[] = {
+        { "globalFlag", getGlobalFlagCallback, setGlobalFlagCallback, kJSPropertyAttributeNone },
+        { 0, 0, 0, 0 }
+    };
+    return staticValues;
+
+}
+
 JSStaticFunction* LayoutTestController::staticFunctions()
 {
     static JSStaticFunction staticFunctions[] = {
@@ -538,3 +565,5 @@
 
     return staticFunctions;
 }
+
+
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 8d70e4f..21ebe31 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -117,6 +117,9 @@
     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;
@@ -138,7 +141,10 @@
     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();
 };