diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-19 00:51:13 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-19 00:51:13 +0000 |
commit | d03c61ae71ffdcd865d02884f187506c40e186e7 (patch) | |
tree | 4cf312823eeb48730c1e01ba31efb91249507558 /webkit/support | |
parent | cd91a007e765486a6b84222bdec474f75bc1fa33 (diff) | |
download | chromium_src-d03c61ae71ffdcd865d02884f187506c40e186e7.zip chromium_src-d03c61ae71ffdcd865d02884f187506c40e186e7.tar.gz chromium_src-d03c61ae71ffdcd865d02884f187506c40e186e7.tar.bz2 |
Try to get webkit tests green by letting DRT load CrApplication early.
This mirrors the change I made to test_shell in r69615
BUG=46929
TEST=webkit tests on waterfall are green
TBR=tony^work
Review URL: http://codereview.chromium.org/5987003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support')
-rw-r--r-- | webkit/support/drt_application_mac.h | 17 | ||||
-rw-r--r-- | webkit/support/drt_application_mac.mm | 18 | ||||
-rw-r--r-- | webkit/support/platform_support_mac.mm | 2 | ||||
-rw-r--r-- | webkit/support/webkit_support.gypi | 2 |
4 files changed, 39 insertions, 0 deletions
diff --git a/webkit/support/drt_application_mac.h b/webkit/support/drt_application_mac.h new file mode 100644 index 0000000..64e91b9 --- /dev/null +++ b/webkit/support/drt_application_mac.h @@ -0,0 +1,17 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_SUPPORT_DRT_APPLICATION_MAC_H +#define WEBKIT_SUPPORT_DRT_APPLICATION_MAC_H + +#include "base/message_pump_mac.h" + +@interface CrDrtApplication : NSApplication<CrAppProtocol> { + @private + BOOL handlingSendEvent_; +} +- (BOOL)isHandlingSendEvent; +@end + +#endif // WEBKIT_SUPPORT_DRT_APPLICATION_MAC_H diff --git a/webkit/support/drt_application_mac.mm b/webkit/support/drt_application_mac.mm new file mode 100644 index 0000000..06ae4a7 --- /dev/null +++ b/webkit/support/drt_application_mac.mm @@ -0,0 +1,18 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/support/drt_application_mac.h" + +@implementation CrDrtApplication +- (BOOL)isHandlingSendEvent { + return handlingSendEvent_; +} + +- (void)sendEvent:(NSEvent*)event { + BOOL wasHandlingSendEvent = handlingSendEvent_; + handlingSendEvent_ = YES; + [super sendEvent:event]; + handlingSendEvent_ = wasHandlingSendEvent; +} +@end diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm index ee90f0c..7aeb80b 100644 --- a/webkit/support/platform_support_mac.mm +++ b/webkit/support/platform_support_mac.mm @@ -18,6 +18,7 @@ #include "grit/webkit_resources.h" #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" #include "webkit/glue/plugins/plugin_list.h" +#import "webkit/support/drt_application_mac.h" #import "webkit/tools/test_shell/mac/DumpRenderTreePasteboard.h" static base::DataPack* g_resource_data_pack = NULL; @@ -27,6 +28,7 @@ namespace webkit_support { static NSAutoreleasePool* autorelease_pool; void BeforeInitialize(bool unit_test_mode) { + [CrDrtApplication sharedApplication]; // Need to initialize NSAutoreleasePool before InitWebCoreSystemInterface(). autorelease_pool = [[NSAutoreleasePool alloc] init]; DCHECK(autorelease_pool); diff --git a/webkit/support/webkit_support.gypi b/webkit/support/webkit_support.gypi index 05dd565..da1e973 100644 --- a/webkit/support/webkit_support.gypi +++ b/webkit/support/webkit_support.gypi @@ -30,6 +30,8 @@ 'UNIT_TEST' ], 'sources': [ + 'drt_application_mac.h', + 'drt_application_mac.mm', 'platform_support.h', 'platform_support_gtk.cc', 'platform_support_mac.mm', |