Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: content/shell/app/shell_main_delegate_mac.mm

Issue 896403002: Revert of Chromium-side patch to rename "--dump-render-tree" to "--run-layout-test". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/shell/app/shell_main_delegate.cc ('k') | content/shell/browser/shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/app/shell_main_delegate_mac.h" 5 #include "content/shell/app/shell_main_delegate_mac.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 11 matching lines...) Expand all
22 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) 22 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType))
23 return; 23 return;
24 24
25 NSString* const kHighResolutionCapable = @"NSHighResolutionCapable"; 25 NSString* const kHighResolutionCapable = @"NSHighResolutionCapable";
26 base::FilePath info_plist = GetInfoPlistPath(); 26 base::FilePath info_plist = GetInfoPlistPath();
27 base::scoped_nsobject<NSMutableDictionary> info_dict( 27 base::scoped_nsobject<NSMutableDictionary> info_dict(
28 [[NSMutableDictionary alloc] 28 [[NSMutableDictionary alloc]
29 initWithContentsOfFile:base::mac::FilePathToNSString(info_plist)]); 29 initWithContentsOfFile:base::mac::FilePathToNSString(info_plist)]);
30 30
31 bool running_layout_tests = base::CommandLine::ForCurrentProcess()->HasSwitch( 31 bool running_layout_tests = base::CommandLine::ForCurrentProcess()->HasSwitch(
32 switches::kRunLayoutTest); 32 switches::kDumpRenderTree);
33 bool not_high_resolution_capable = 33 bool not_high_resolution_capable =
34 [info_dict objectForKey:kHighResolutionCapable] && 34 [info_dict objectForKey:kHighResolutionCapable] &&
35 [[info_dict objectForKey:kHighResolutionCapable] isEqualToNumber:@(NO)]; 35 [[info_dict objectForKey:kHighResolutionCapable] isEqualToNumber:@(NO)];
36 if (running_layout_tests == not_high_resolution_capable) 36 if (running_layout_tests == not_high_resolution_capable)
37 return; 37 return;
38 38
39 // We need to update our Info.plist before we can continue. 39 // We need to update our Info.plist before we can continue.
40 [info_dict setObject:@(!running_layout_tests) forKey:kHighResolutionCapable]; 40 [info_dict setObject:@(!running_layout_tests) forKey:kHighResolutionCapable];
41 CHECK([info_dict writeToFile:base::mac::FilePathToNSString(info_plist) 41 CHECK([info_dict writeToFile:base::mac::FilePathToNSString(info_plist)
42 atomically:YES]); 42 atomically:YES]);
43 43
44 const base::CommandLine::StringVector& original_argv = 44 const base::CommandLine::StringVector& original_argv =
45 base::CommandLine::ForCurrentProcess()->argv(); 45 base::CommandLine::ForCurrentProcess()->argv();
46 char** argv = new char*[original_argv.size() + 1]; 46 char** argv = new char*[original_argv.size() + 1];
47 for (unsigned i = 0; i < original_argv.size(); ++i) 47 for (unsigned i = 0; i < original_argv.size(); ++i)
48 argv[i] = const_cast<char*>(original_argv.at(i).c_str()); 48 argv[i] = const_cast<char*>(original_argv.at(i).c_str());
49 argv[original_argv.size()] = NULL; 49 argv[original_argv.size()] = NULL;
50 50
51 CHECK(execvp(argv[0], argv)); 51 CHECK(execvp(argv[0], argv));
52 } 52 }
53 53
54 } // namespace content 54 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/app/shell_main_delegate.cc ('k') | content/shell/browser/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698