• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 #ifndef CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_APPLESCRIPT_UTILS_UNITTEST_H_
6 #define CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_APPLESCRIPT_UTILS_UNITTEST_H_
7 
8 #import <objc/objc-runtime.h>
9 #import <Cocoa/Cocoa.h>
10 
11 #include "base/memory/scoped_nsobject.h"
12 #import "chrome/browser/app_controller_mac.h"
13 #import "chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.h"
14 #include "chrome/browser/ui/cocoa/browser_test_helper.h"
15 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
16 #include "chrome/test/model_test_utils.h"
17 #include "testing/platform_test.h"
18 
19 class BookmarkModel;
20 
21 // The fake object that acts as our app's delegate, useful for testing purposes.
22 @interface FakeAppDelegate : AppController {
23  @public
24   BrowserTestHelper* helper_;  // weak.
25 }
26 @property(nonatomic) BrowserTestHelper* helper;
27 // Return the |TestingProfile*| which is used for testing.
28 - (Profile*)defaultProfile;
29 @end
30 
31 
32 // Used to emulate an active running script, useful for testing purposes.
33 @interface FakeScriptCommand : NSScriptCommand {
34   Method originalMethod_;
35   Method alternateMethod_;
36 }
37 @end
38 
39 
40 // The base class for all our bookmark releated unit tests.
41 class BookmarkAppleScriptTest : public CocoaTest {
42  public:
43   BookmarkAppleScriptTest();
44   virtual ~BookmarkAppleScriptTest();
45  private:
46   BrowserTestHelper helper_;
47   scoped_nsobject<FakeAppDelegate> appDelegate_;
48  protected:
49   scoped_nsobject<BookmarkFolderAppleScript> bookmarkBar_;
50   BookmarkModel& model();
51 };
52 
53 #endif
54 // CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_APPLESCRIPT_UTILS_UNITTEST_H_
55