mock_chrome_application_mac.h 982 B

123456789101112131415161718192021222324252627282930313233
  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
  3. // found in the LICENSE file.
  4. #ifndef BASE_TEST_MOCK_CHROME_APPLICATION_MAC_H_
  5. #define BASE_TEST_MOCK_CHROME_APPLICATION_MAC_H_
  6. #if defined(__OBJC__)
  7. #import <AppKit/AppKit.h>
  8. #include "base/mac/scoped_sending_event.h"
  9. #include "base/message_loop/message_pump_mac.h"
  10. // A basic implementation of CrAppProtocol and
  11. // CrAppControlProtocol. This can be used in tests that need an
  12. // NSApplication and use a runloop, or which need a ScopedSendingEvent
  13. // when handling a nested event loop.
  14. @interface MockCrApp : NSApplication<CrAppProtocol,
  15. CrAppControlProtocol> {
  16. @private
  17. BOOL _handlingSendEvent;
  18. }
  19. @end
  20. #endif
  21. // To be used to instantiate MockCrApp from C++ code.
  22. namespace mock_cr_app {
  23. void RegisterMockCrApp();
  24. } // namespace mock_cr_app
  25. #endif // BASE_TEST_MOCK_CHROME_APPLICATION_MAC_H_