Change SOP error to a warning. Warn about problematic testing setup in CPWebViewTest.

This commit is contained in:
Alexander Ljungberg
2011-03-05 19:52:39 -03:00
parent 6f8d2190f5
commit e214d49ea9
4 changed files with 17 additions and 35 deletions
+1 -1
View File
@@ -279,7 +279,7 @@ CPWebViewScrollNative = 2;
}
else if (_scrollMode == CPWebViewScrollAppKit && !_contentIsAccessible)
{
CPLog.error(self + " unable to use CPWebViewScrollAppKit scroll mode due to same origin policy.");
CPLog.warn(self + " unable to use CPWebViewScrollAppKit scroll mode due to same origin policy.");
_newScrollMode = CPWebViewScrollNative;
}
+9 -3
View File
@@ -23,8 +23,6 @@
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
[webView1 setScrollMode:CPWebViewScrollAuto];
[webView1 loadHTMLString:"<html><body><img src='http://cappuccino.org/images/cappuccino-icon.png'><img src='http://cappuccino.org/images/cappuccino-icon.png'></body></html>"];
@@ -36,7 +34,15 @@
[webView4 setScrollMode:CPWebViewScrollNative];
[webView4 setMainFrameURL:[[CPBundle mainBundle] pathForResource:"hello_world.html"]];
// XXX If this program is run from file:// in Safari, it will actually have SOP access.
/*
XXX If this program is run from file:// in Safari, it will actually have SOP access,
disturbing test #5 and #6. A simple way to run this test is to change the current directory
to the root of the test and executing:
python -m "SimpleHTTPServer"
*/
if (document.location.href.indexOf('file://') == 0)
alert("This test should be run from http://, not file:// in order to properly enable SOP testing.");
[webView5 setScrollMode:CPWebViewScrollAuto];
[webView5 setMainFrameURL:"http://www.cappuccino.org"];
File diff suppressed because one or more lines are too long
@@ -66,7 +66,7 @@
<object class="NSTextFieldCell" key="NSCell" id="701605033">
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272631296</int>
<string key="NSContents">Scroll Mode: Auto Content: HTML Expected Result: Cappuccino Scrollbars</string>
<string key="NSContents">#1. Scroll Mode: Auto Content: HTML Expected Result: Cappuccino Scrollbars</string>
<object class="NSFont" key="NSSupport" id="554332617">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
@@ -152,7 +152,7 @@
<object class="NSTextFieldCell" key="NSCell" id="454719405">
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272631296</int>
<string key="NSContents">Scroll Mode: Auto Content: SOP OK Expected Result: Cappuccino Scrollbars</string>
<string key="NSContents">#3. Scroll Mode: Auto Content: SOP OK Expected Result: Cappuccino Scrollbars</string>
<reference key="NSSupport" ref="554332617"/>
<reference key="NSControlView" ref="45596274"/>
<reference key="NSBackgroundColor" ref="400417361"/>
@@ -201,7 +201,7 @@
<object class="NSTextFieldCell" key="NSCell" id="506188802">
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272631296</int>
<string key="NSContents">Scroll Mode: Native Content: HTML Expected Result: Native Scrollbars</string>
<string key="NSContents">#2. Scroll Mode: Native Content: HTML Expected Result: Native Scrollbars</string>
<reference key="NSSupport" ref="554332617"/>
<reference key="NSControlView" ref="763812597"/>
<reference key="NSBackgroundColor" ref="400417361"/>
@@ -250,7 +250,7 @@
<object class="NSTextFieldCell" key="NSCell" id="365555838">
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272631296</int>
<string key="NSContents">Scroll Mode: Auto Content: SOP NO Expected Result: Native Scrollbars</string>
<string key="NSContents">#5. Scroll Mode: Auto Content: SOP NO Expected Result: Native Scrollbars</string>
<reference key="NSSupport" ref="554332617"/>
<reference key="NSControlView" ref="554761570"/>
<reference key="NSBackgroundColor" ref="400417361"/>
@@ -299,7 +299,7 @@
<object class="NSTextFieldCell" key="NSCell" id="107016852">
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272631296</int>
<string key="NSContents">Scroll Mode: Native Content: SOP OK Expected Result: Native Scrollbars</string>
<string key="NSContents">#4. Scroll Mode: Native Content: SOP OK Expected Result: Native Scrollbars</string>
<reference key="NSSupport" ref="554332617"/>
<reference key="NSControlView" ref="863007491"/>
<reference key="NSBackgroundColor" ref="400417361"/>
@@ -348,7 +348,7 @@
<object class="NSTextFieldCell" key="NSCell" id="324402773">
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272631296</int>
<string key="NSContents">Scroll Mode: AppKit Content: SOP NO Expected Result: Logged Error</string>
<string key="NSContents">#6. Scroll Mode: AppKit Content: SOP NO Expected Result: Native + Warning</string>
<reference key="NSSupport" ref="554332617"/>
<reference key="NSControlView" ref="553862803"/>
<reference key="NSBackgroundColor" ref="400417361"/>
@@ -418,30 +418,6 @@
</object>
<int key="connectionID">459</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">localAutoWebView</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="35073658"/>
</object>
<int key="connectionID">488</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">remoteAutoWebView</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="971873522"/>
</object>
<int key="connectionID">489</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">localNativeWebView</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="626072679"/>
</object>
<int key="connectionID">490</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">webView1</string>