- Revision
- 158326
- Author
- a...@apple.com
- Date
- 2013-10-30 16:43:06 -0700 (Wed, 30 Oct 2013)
Log Message
85 inspector tests asserting in DrawingAreaProxyImpl::updateAcceleratedCompositingMode()
when there is a stale WebKitTestRunner preference
https://bugs.webkit.org/show_bug.cgi?id=115115
Reviewed by Darin Adler.
Source/WebCore:
* page/Settings.cpp:
(WebCore::Settings::setMockScrollbarsEnabled):
(WebCore::Settings::setUsesOverlayScrollbars):
Added FIXMEs.
Tools:
Delete stale preferences on launch.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize): Now that we don't have preferences stored from
the previous run, we need th reinstate them before creating a WKView. Not all preferences
can be applied to an existing view retroactively.
(WTR::TestController::resetPreferencesToConsistentValues): Split out of resetStateToConsistentValues,
because there is no injected bundle yet when calling this function from initialize().
* WebKitTestRunner/mac/main.mm: (setDefaultsToConsistentValuesForTesting): Delete
the preferences.
* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm: (WTR::InjectedBundle::platformInitialize):
Added some FIXMEs.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (158325 => 158326)
--- trunk/Source/WebCore/ChangeLog 2013-10-30 23:13:49 UTC (rev 158325)
+++ trunk/Source/WebCore/ChangeLog 2013-10-30 23:43:06 UTC (rev 158326)
@@ -1,3 +1,16 @@
+2013-10-30 Alexey Proskuryakov <a...@apple.com>
+
+ 85 inspector tests asserting in DrawingAreaProxyImpl::updateAcceleratedCompositingMode()
+ when there is a stale WebKitTestRunner preference
+ https://bugs.webkit.org/show_bug.cgi?id=115115
+
+ Reviewed by Darin Adler.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::setMockScrollbarsEnabled):
+ (WebCore::Settings::setUsesOverlayScrollbars):
+ Added FIXMEs.
+
2013-10-30 Andreas Kling <akl...@apple.com>
Take line boxes out of the arena.
Modified: trunk/Source/WebCore/page/Settings.cpp (158325 => 158326)
--- trunk/Source/WebCore/page/Settings.cpp 2013-10-30 23:13:49 UTC (rev 158325)
+++ trunk/Source/WebCore/page/Settings.cpp 2013-10-30 23:43:06 UTC (rev 158326)
@@ -595,6 +595,7 @@
void Settings::setMockScrollbarsEnabled(bool flag)
{
gMockScrollbarsEnabled = flag;
+ // FIXME: This should update scroll bars in existing pages.
}
bool Settings::mockScrollbarsEnabled()
@@ -605,6 +606,7 @@
void Settings::setUsesOverlayScrollbars(bool flag)
{
gUsesOverlayScrollbars = flag;
+ // FIXME: This should update scroll bars in existing pages.
}
bool Settings::usesOverlayScrollbars()
Modified: trunk/Tools/ChangeLog (158325 => 158326)
--- trunk/Tools/ChangeLog 2013-10-30 23:13:49 UTC (rev 158325)
+++ trunk/Tools/ChangeLog 2013-10-30 23:43:06 UTC (rev 158326)
@@ -1,3 +1,27 @@
+2013-10-30 Alexey Proskuryakov <a...@apple.com>
+
+ 85 inspector tests asserting in DrawingAreaProxyImpl::updateAcceleratedCompositingMode()
+ when there is a stale WebKitTestRunner preference
+ https://bugs.webkit.org/show_bug.cgi?id=115115
+
+ Reviewed by Darin Adler.
+
+ Delete stale preferences on launch.
+
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Now that we don't have preferences stored from
+ the previous run, we need th reinstate them before creating a WKView. Not all preferences
+ can be applied to an existing view retroactively.
+ (WTR::TestController::resetPreferencesToConsistentValues): Split out of resetStateToConsistentValues,
+ because there is no injected bundle yet when calling this function from initialize().
+
+ * WebKitTestRunner/mac/main.mm: (setDefaultsToConsistentValuesForTesting): Delete
+ the preferences.
+
+ * WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm: (WTR::InjectedBundle::platformInitialize):
+ Added some FIXMEs.
+
2013-10-30 Anders Carlsson <ander...@apple.com>
Try to fix the 32-bit build.
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm (158325 => 158326)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm 2013-10-30 23:13:49 UTC (rev 158325)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm 2013-10-30 23:43:06 UTC (rev 158326)
@@ -44,6 +44,9 @@
NSDictionary *dict = @{
@"AppleAntiAliasingThreshold": @4,
+ // FIXME: Setting AppleFontSmoothing is likely unnecessary and ineffective. WebKit2 has its own preference for font smoothing, which is
+ // applied to each context via CGContextSetShouldSmoothFonts, presumably overriding the default. And it's too late to do this here,
+ // see <https://bugs.webkit.org/show_bug.cgi?id=123488>
@"AppleFontSmoothing": @(NoFontSmoothing),
@"AppleAquaColorVariant": @(BlueTintedAppearance),
@"AppleHighlightColor": @"0.709800 0.835300 1.000000",
@@ -51,6 +54,8 @@
@"NSScrollAnimationEnabled": @NO,
@"NSOverlayScrollersEnabled": @NO,
@"AppleShowScrollBars": @"Always",
+ // FIXME (<rdar://problem/13396515>): It is too late to set AppleLanguages here, as loaded frameworks localizations cannot be changed.
+ // This breaks some accessibility tests on machines with non-English user language.
@"AppleLanguages": @[ @"en" ],
// FIXME: Why does this dictionary not match the one in DumpRenderTree?
@"NSTestCorrectionDictionary": @{
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (158325 => 158326)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2013-10-30 23:13:49 UTC (rev 158325)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2013-10-30 23:43:06 UTC (rev 158326)
@@ -395,6 +395,9 @@
if (testPluginDirectory())
WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory());
+ // Some preferences (notably mock scroll bars setting) currently cannot be re-applied to an existing view, so we need to set them now.
+ resetPreferencesToConsistentValues();
+
createWebViewWithOptions(0);
}
@@ -523,30 +526,8 @@
}
}
-bool TestController::resetStateToConsistentValues()
+void TestController::resetPreferencesToConsistentValues()
{
- m_state = Resetting;
-
- m_beforeUnloadReturnValue = true;
-
- WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("Reset"));
- WKRetainPtr<WKMutableDictionaryRef> resetMessageBody = adoptWK(WKMutableDictionaryCreate());
-
- WKRetainPtr<WKStringRef> shouldGCKey = adoptWK(WKStringCreateWithUTF8CString("ShouldGC"));
- WKRetainPtr<WKBooleanRef> shouldGCValue = adoptWK(WKBooleanCreate(m_gcBetweenTests));
- WKDictionaryAddItem(resetMessageBody.get(), shouldGCKey.get(), shouldGCValue.get());
-
- WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), resetMessageBody.get());
-
- WKContextSetShouldUseFontSmoothing(TestController::shared().context(), false);
-
- WKContextSetCacheModel(TestController::shared().context(), kWKCacheModelDocumentBrowser);
-
- // FIXME: This function should also ensure that there is only one page open.
-
- // Reset the EventSender for each test.
- m_eventSenderProxy = adoptPtr(new EventSenderProxy(this));
-
// Reset preferences
WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
WKPreferencesResetTestRunnerOverrides(preferences);
@@ -589,6 +570,36 @@
WKPreferencesSetSerifFontFamily(preferences, serifFontFamily);
WKPreferencesSetScreenFontSubstitutionEnabled(preferences, true);
WKPreferencesSetAsynchronousSpellCheckingEnabled(preferences, false);
+}
+
+bool TestController::resetStateToConsistentValues()
+{
+ m_state = Resetting;
+
+ m_beforeUnloadReturnValue = true;
+
+ WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("Reset"));
+ WKRetainPtr<WKMutableDictionaryRef> resetMessageBody = adoptWK(WKMutableDictionaryCreate());
+
+ WKRetainPtr<WKStringRef> shouldGCKey = adoptWK(WKStringCreateWithUTF8CString("ShouldGC"));
+ WKRetainPtr<WKBooleanRef> shouldGCValue = adoptWK(WKBooleanCreate(m_gcBetweenTests));
+ WKDictionaryAddItem(resetMessageBody.get(), shouldGCKey.get(), shouldGCValue.get());
+
+ WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), resetMessageBody.get());
+
+ WKContextSetShouldUseFontSmoothing(TestController::shared().context(), false);
+
+ WKContextSetCacheModel(TestController::shared().context(), kWKCacheModelDocumentBrowser);
+
+ // FIXME: This function should also ensure that there is only one page open.
+
+ // Reset the EventSender for each test.
+ m_eventSenderProxy = adoptPtr(new EventSenderProxy(this));
+
+ // FIXME: Is this needed? Nothing in TestController changes preferences during tests, and if there is
+ // some other code doing this, it should probably be responsible for cleanup too.
+ resetPreferencesToConsistentValues();
+
#if !PLATFORM(MAC)
WKTextCheckerContinuousSpellCheckingEnabledStateChanged(true);
#endif
Modified: trunk/Tools/WebKitTestRunner/TestController.h (158325 => 158326)
--- trunk/Tools/WebKitTestRunner/TestController.h 2013-10-30 23:13:49 UTC (rev 158325)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2013-10-30 23:43:06 UTC (rev 158326)
@@ -93,6 +93,7 @@
void setVisibilityState(WKPageVisibilityState, bool isInitialState);
bool resetStateToConsistentValues();
+ void resetPreferencesToConsistentValues();
WorkQueueManager& workQueueManager() { return m_workQueueManager; }
Modified: trunk/Tools/WebKitTestRunner/mac/main.mm (158325 => 158326)
--- trunk/Tools/WebKitTestRunner/mac/main.mm 2013-10-30 23:13:49 UTC (rev 158325)
+++ trunk/Tools/WebKitTestRunner/mac/main.mm 2013-10-30 23:43:06 UTC (rev 158326)
@@ -29,6 +29,8 @@
static void setDefaultsToConsistentValuesForTesting()
{
+ [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@"WebKitTestRunner"];
+
NSDictionary *dict = @{
@"AppleKeyboardUIMode": @1,
@"AppleMagnifiedMode": @YES,