<rdar://problem/17782529> REGRESSION: OS marketing version in iOS Simulator user...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Aug 2014 19:21:49 +0000 (19:21 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Aug 2014 19:21:49 +0000 (19:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135549

Reviewed by Mark Rowe.

* platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion): On the iOS Simulator, locate the system Library
directory relative to the Simulator root.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/SystemVersion.mm

index 0d0024b..e4183e1 100644 (file)
@@ -1,3 +1,14 @@
+2014-08-03  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/17782529> REGRESSION: OS marketing version in iOS Simulator user-agent string is the host OS’s
+        https://bugs.webkit.org/show_bug.cgi?id=135549
+
+        Reviewed by Mark Rowe.
+
+        * platform/cocoa/SystemVersion.mm:
+        (WebCore::createSystemMarketingVersion): On the iOS Simulator, locate the system Library
+        directory relative to the Simulator root.
+
 2014-08-02  Jeremy Jones  <jeremyj@apple.com>
 
         Support both window and view based video fullscreen.
index 732101e..b7aa82c 100644 (file)
@@ -33,6 +33,10 @@ static NSString *createSystemMarketingVersion()
 {
     // Can't use -[NSProcessInfo operatingSystemVersionString] because it has too much stuff we don't want.
     NSString *systemLibraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSSystemDomainMask, YES) objectAtIndex:0];
+#if PLATFORM(IOS_SIMULATOR)
+    if (char *simulatorRoot = getenv("SIMULATOR_ROOT"))
+        systemLibraryPath = [NSString stringWithFormat:@"%s/%@", simulatorRoot, systemLibraryPath];
+#endif
     NSString *systemVersionPlistPath = [systemLibraryPath stringByAppendingPathComponent:@"CoreServices/SystemVersion.plist"];
     NSDictionary *systemVersionInfo = [NSDictionary dictionaryWithContentsOfFile:systemVersionPlistPath];
     return [[systemVersionInfo objectForKey:@"ProductVersion"] copy];