diff options
author | lliabraa@chromium.org <lliabraa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 16:18:08 +0000 |
---|---|---|
committer | lliabraa@chromium.org <lliabraa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 16:18:08 +0000 |
commit | 6ad69f847435e99d9448909e95d940158fad1cad (patch) | |
tree | e72da5d2bc7fc22404c1f9632ee82da356ef6567 /testing | |
parent | b8dbb2644463a10b842bd8b4d9fa19a4a00e69c2 (diff) | |
download | chromium_src-6ad69f847435e99d9448909e95d940158fad1cad.zip chromium_src-6ad69f847435e99d9448909e95d940158fad1cad.tar.gz chromium_src-6ad69f847435e99d9448909e95d940158fad1cad.tar.bz2 |
Fix iossim's support for retina devices.
Mac 10.8 started caching prefs so even though iossim writes the SimulatorDevice
value to the .plist on disk, the iPhone Simulator may not see that change and
therefore not respect the -d (device) parameter passed to iossim.
Using the CFPreferences API to set and sync the pref fixes the issue.
BUG=224892
Review URL: https://chromiumcodereview.appspot.com/14308003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing')
-rw-r--r-- | testing/iossim/iossim.mm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm index 7d5dbf8..ac03dcd 100644 --- a/testing/iossim/iossim.mm +++ b/testing/iossim/iossim.mm @@ -491,12 +491,11 @@ BOOL InitializeSimulatorUserHome(NSString* userHomePath, NSString* deviceName) { // Set the device to simulate. Note that the iOS Simulator must not be running // for this setting to take effect. - NSMutableDictionary* plistDict = - [NSMutableDictionary dictionaryWithObject:deviceName - forKey:@"SimulateDevice"]; - NSString* plistPath = @"Library/Preferences/com.apple.iphonesimulator.plist"; - [plistDict writeToFile:[userHomePath stringByAppendingPathComponent:plistPath] - atomically:YES]; + CFStringRef iPhoneSimulatorAppID = CFSTR("com.apple.iphonesimulator"); + CFPreferencesSetAppValue(CFSTR("SimulateDevice"), + deviceName, + iPhoneSimulatorAppID); + CFPreferencesAppSynchronize(iPhoneSimulatorAppID); // Update the environment to use the specified directory as the user home // directory. |