WebKitTestRunner declarative language setting is broken for iOS
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 01:21:54 +0000 (01:21 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 01:21:54 +0000 (01:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149119

Unreviewed.

Tools:

In all of the patches on webkit.org/b/189669, my patch to get this working on iOS was
lost in the final version which got committed. This simply implements the existing
OS X behavior on iOS.

* WebKitTestRunner/InjectedBundle/ios/InjectedBundleIOS.mm:
(WTR::InjectedBundle::platformInitialize):

LayoutTests:

* platform/ios-simulator/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189768 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/ios-simulator/TestExpectations
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/ios/InjectedBundleIOS.mm

index 2e33ea6..e1b2621 100644 (file)
@@ -1,3 +1,12 @@
+2015-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        WebKitTestRunner declarative language setting is broken for iOS
+        https://bugs.webkit.org/show_bug.cgi?id=149119
+
+        Unreviewed.
+
+        * platform/ios-simulator/TestExpectations:
+
 2015-09-14  Chris Dumez  <cdumez@apple.com>
 
         Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
index 318753f..5d7f8f5 100644 (file)
@@ -2815,6 +2815,3 @@ http/tests/security/mixedContent/websocket/insecure-websocket-in-main-frame.html
 
 # -webkit-flex off-by-one px
 webkit.org/b/126898 css3/flexbox/image-percent-max-height.html [ ImageOnlyFailure ]
-
-# WebKitTestRunner declarative language setting is broken for iOS
-webkit.org/b/149119 fast/text/international/system-language [ Skip ]
index 680e43e..7c36d94 100644 (file)
@@ -1,3 +1,17 @@
+2015-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        WebKitTestRunner declarative language setting is broken for iOS
+        https://bugs.webkit.org/show_bug.cgi?id=149119
+
+        Unreviewed.
+
+        In all of the patches on webkit.org/b/189669, my patch to get this working on iOS was
+        lost in the final version which got committed. This simply implements the existing
+        OS X behavior on iOS.
+
+        * WebKitTestRunner/InjectedBundle/ios/InjectedBundleIOS.mm:
+        (WTR::InjectedBundle::platformInitialize):
+
 2015-09-14  Dewei Zhu  <dewei_zhu@apple.com>
 
         Unreviewed, add myself to committers list.
index 7f82be7..030f905 100644 (file)
@@ -35,9 +35,14 @@ namespace WTR {
 
 void InjectedBundle::platformInitialize(WKTypeRef)
 {
-    NSDictionary *dict = [NSDictionary dictionary];
+    // Language was set up earlier in main(). Don't clobber it.
+    NSArray *languages = [[[NSUserDefaults standardUserDefaults] volatileDomainForName:NSArgumentDomain] valueForKey:@"AppleLanguages"];
 
-    [[NSUserDefaults standardUserDefaults] setVolatileDomain:dict forName:NSArgumentDomain];
+    RetainPtr<NSMutableDictionary *> dict = adoptNS([[NSMutableDictionary alloc] init]);
+    if (languages)
+        [dict setObject:languages forKey:@"AppleLanguages"];
+
+    [[NSUserDefaults standardUserDefaults] setVolatileDomain:dict.get() forName:NSArgumentDomain];
 
     [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:@"localhost"];
     [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:@"127.0.0.1"];