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