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

Unified Diff: base/test/mock_chrome_application_mac.h

Issue 5950003: Remove CrApplication dependency from base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: '' Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: base/test/mock_chrome_application_mac.h
diff --git a/base/test/mock_chrome_application_mac.h b/base/test/mock_chrome_application_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..58ceeb0250a7cef2d9bb3674e1a8fbd2d54249fa
--- /dev/null
+++ b/base/test/mock_chrome_application_mac.h
@@ -0,0 +1,29 @@
+// 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 BASE_TEST_MOCK_CHROME_APPLICATION_MAC_H_
+#define BASE_TEST_MOCK_CHROME_APPLICATION_MAC_H_
+#pragma once
+
Mark Mentovai 2010/12/17 17:31:38 Extra blank line.
Nico 2010/12/18 01:14:28 Done.
+
+#ifdef __OBJC__
Mark Mentovai 2010/12/17 17:31:38 Chromium code prefers #if defined(__OBJC__).
Nico 2010/12/18 01:14:28 Done.
+
+#import <Cocoa/Cocoa.h>
Mark Mentovai 2010/12/17 17:31:38 You can get away with just AppKit/AppKit.h.
Nico 2010/12/18 01:14:28 Done.
+
+#include "base/message_pump_mac.h"
+
+// A mock implementation of CrAppProtocol that claims that -sendEvent: is never
+// on the stack. This can be used in tests that need an NSApplication and which
dmac 2010/12/17 18:00:16 I think you can get rid of both "whichs" in the la
Nico 2010/12/18 01:14:28 Done.
+// use a runloop, but which don't run nested message loops.
+@interface MockCrApp : NSApplication<CrAppProtocol>
+@end
+
+#endif
+
+// To be used to instantiate MockCrApp from C++ code.
+namespace mock_cr_app {
+void RegisterMockCrApp();
+}
Mark Mentovai 2010/12/17 17:31:38 } // namespace mock_cr_app
Nico 2010/12/18 01:14:28 Done.
+
+#endif // BASE_TEST_MOCK_CHROME_APPLICATION_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698