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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #import "chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.h" | 10 #import "chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.h" |
11 #import "chrome/browser/ui/cocoa/applescript/constants_applescript.h" | 11 #import "chrome/browser/ui/cocoa/applescript/constants_applescript.h" |
12 #import "chrome/browser/ui/cocoa/applescript/window_applescript.h" | 12 #import "chrome/browser/ui/cocoa/applescript/window_applescript.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "testing/gtest_mac.h" | 15 #include "testing/gtest_mac.h" |
16 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
17 | 17 |
18 typedef InProcessBrowserTest BrowserCrApplicationAppleScriptTest; | 18 typedef InProcessBrowserTest BrowserCrApplicationAppleScriptTest; |
19 | 19 |
20 // Create windows of different |Type|. | 20 // Create windows of different |Type|. |
21 IN_PROC_BROWSER_TEST_F(BrowserCrApplicationAppleScriptTest, Creation) { | 21 IN_PROC_BROWSER_TEST_F(BrowserCrApplicationAppleScriptTest, Creation) { |
22 // Create additional |Browser*| objects of different type. | 22 // Create additional |Browser*| objects of different type. |
23 Profile* profile = browser()->profile(); | 23 Profile* profile = browser()->profile(); |
24 Browser* b1 = Browser::CreateWithParams( | 24 Browser* b1 = |
25 Browser::CreateParams(Browser::TYPE_POPUP, profile)); | 25 new Browser(Browser::CreateParams(Browser::TYPE_POPUP, profile)); |
26 Browser* b2 = Browser::CreateWithParams( | 26 Browser* b2 = new Browser( |
27 Browser::CreateParams::CreateForApp( | 27 Browser::CreateParams::CreateForApp( |
28 Browser::TYPE_PANEL, "Test", gfx::Rect(), profile)); | 28 Browser::TYPE_PANEL, "Test", gfx::Rect(), profile)); |
29 | 29 |
30 EXPECT_EQ(3U, [[NSApp appleScriptWindows] count]); | 30 EXPECT_EQ(3U, [[NSApp appleScriptWindows] count]); |
31 for (WindowAppleScript* window in [NSApp appleScriptWindows]) { | 31 for (WindowAppleScript* window in [NSApp appleScriptWindows]) { |
32 EXPECT_NSEQ(AppleScript::kWindowsProperty, | 32 EXPECT_NSEQ(AppleScript::kWindowsProperty, |
33 [window containerProperty]); | 33 [window containerProperty]); |
34 EXPECT_NSEQ(NSApp, [window container]); | 34 EXPECT_NSEQ(NSApp, [window container]); |
35 } | 35 } |
36 | 36 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 for (BookmarkFolderAppleScript* bookmarkFolder in bookmarkFolders) { | 102 for (BookmarkFolderAppleScript* bookmarkFolder in bookmarkFolders) { |
103 EXPECT_EQ(NSApp, | 103 EXPECT_EQ(NSApp, |
104 [bookmarkFolder container]); | 104 [bookmarkFolder container]); |
105 EXPECT_NSEQ(AppleScript::kBookmarkFoldersProperty, | 105 EXPECT_NSEQ(AppleScript::kBookmarkFoldersProperty, |
106 [bookmarkFolder containerProperty]); | 106 [bookmarkFolder containerProperty]); |
107 } | 107 } |
108 | 108 |
109 EXPECT_NSEQ(@"Other Bookmarks", [[NSApp otherBookmarks] title]); | 109 EXPECT_NSEQ(@"Other Bookmarks", [[NSApp otherBookmarks] title]); |
110 EXPECT_NSEQ(@"Bookmarks Bar", [[NSApp bookmarksBar] title]); | 110 EXPECT_NSEQ(@"Bookmarks Bar", [[NSApp bookmarksBar] title]); |
111 } | 111 } |
OLD | NEW |