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