OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 // #include <Carbon/Carbon.h> | 7 // #include <Carbon/Carbon.h> |
8 // #include <ApplicationServices/ApplicationServices.h> | 8 // #include <ApplicationServices/ApplicationServices.h> |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 #import <objc/objc-runtime.h> | 10 #import <objc/objc-runtime.h> |
11 #include <mach/task.h> | 11 #include <mach/task.h> |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_pump_mac.h" | 15 #include "base/message_pump_mac.h" |
16 #import "base/test/mock_chrome_application_mac.h" | 16 #import "base/test/mock_chrome_application_mac.h" |
17 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface
.h" | |
18 #include "webkit/tools/test_shell/test_shell.h" | 17 #include "webkit/tools/test_shell/test_shell.h" |
19 #include "webkit/tools/test_shell/test_shell_platform_delegate.h" | 18 #include "webkit/tools/test_shell/test_shell_platform_delegate.h" |
20 #include "webkit/tools/test_shell/test_shell_switches.h" | 19 #include "webkit/tools/test_shell/test_shell_switches.h" |
21 | 20 |
22 static NSAutoreleasePool *gTestShellAutoreleasePool = nil; | 21 static NSAutoreleasePool *gTestShellAutoreleasePool = nil; |
23 | 22 |
24 static void SetDefaultsToLayoutTestValues(void) { | 23 static void SetDefaultsToLayoutTestValues(void) { |
25 // So we can match the WebKit layout tests, we want to force a bunch of | 24 // So we can match the WebKit layout tests, we want to force a bunch of |
26 // preferences that control appearance to match. | 25 // preferences that control appearance to match. |
27 // (We want to do this as early as possible in application startup so | 26 // (We want to do this as early as possible in application startup so |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 object_getClass(originalClass)); | 148 object_getClass(originalClass)); |
150 #endif | 149 #endif |
151 } | 150 } |
152 | 151 |
153 TestShellPlatformDelegate::TestShellPlatformDelegate( | 152 TestShellPlatformDelegate::TestShellPlatformDelegate( |
154 const CommandLine &command_line) | 153 const CommandLine &command_line) |
155 : command_line_(command_line) { | 154 : command_line_(command_line) { |
156 gTestShellAutoreleasePool = [[NSAutoreleasePool alloc] init]; | 155 gTestShellAutoreleasePool = [[NSAutoreleasePool alloc] init]; |
157 // Force AppKit to init itself, but don't start the runloop yet | 156 // Force AppKit to init itself, but don't start the runloop yet |
158 [MockCrApp sharedApplication]; | 157 [MockCrApp sharedApplication]; |
159 InitWebCoreSystemInterface(); | |
160 [NSBundle loadNibNamed:@"MainMenu" owner:NSApp]; | 158 [NSBundle loadNibNamed:@"MainMenu" owner:NSApp]; |
161 } | 159 } |
162 | 160 |
163 TestShellPlatformDelegate::~TestShellPlatformDelegate() { | 161 TestShellPlatformDelegate::~TestShellPlatformDelegate() { |
164 [gTestShellAutoreleasePool drain]; | 162 [gTestShellAutoreleasePool drain]; |
165 } | 163 } |
166 | 164 |
167 bool TestShellPlatformDelegate::CheckLayoutTestSystemDependencies() { | 165 bool TestShellPlatformDelegate::CheckLayoutTestSystemDependencies() { |
168 return true; | 166 return true; |
169 } | 167 } |
(...skipping 19 matching lines...) Expand all Loading... |
189 | 187 |
190 // If we die during tests, we don't want to be spamming the user's crash | 188 // If we die during tests, we don't want to be spamming the user's crash |
191 // reporter. Set our exception port to null and add signal handlers. | 189 // reporter. Set our exception port to null and add signal handlers. |
192 // Both of these are necessary to avoid the crash reporter. Although, we do | 190 // Both of these are necessary to avoid the crash reporter. Although, we do |
193 // still seem to be missing some cases. | 191 // still seem to be missing some cases. |
194 if (!parsed_command_line.HasSwitch(test_shell::kGDB)) { | 192 if (!parsed_command_line.HasSwitch(test_shell::kGDB)) { |
195 task_set_exception_ports(mach_task_self(), EXC_MASK_ALL, MACH_PORT_NULL, | 193 task_set_exception_ports(mach_task_self(), EXC_MASK_ALL, MACH_PORT_NULL, |
196 EXCEPTION_DEFAULT, THREAD_STATE_NONE); | 194 EXCEPTION_DEFAULT, THREAD_STATE_NONE); |
197 } | 195 } |
198 } | 196 } |
OLD | NEW |