Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: chrome/browser/cocoa/applescript/window_applescript_test.mm

Issue 3163008: Removed a command which resulted in a crash.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/applescript/window_applescript.mm ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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>
6
5 #import "base/scoped_nsobject.h" 7 #import "base/scoped_nsobject.h"
6 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
7 #import "chrome/browser/app_controller_mac.h" 9 #import "chrome/browser/app_controller_mac.h"
8 #import "chrome/browser/chrome_browser_application_mac.h" 10 #import "chrome/browser/chrome_browser_application_mac.h"
9 #import "chrome/browser/cocoa/applescript/constants_applescript.h" 11 #import "chrome/browser/cocoa/applescript/constants_applescript.h"
10 #import "chrome/browser/cocoa/applescript/error_applescript.h" 12 #import "chrome/browser/cocoa/applescript/error_applescript.h"
11 #import "chrome/browser/cocoa/applescript/tab_applescript.h" 13 #import "chrome/browser/cocoa/applescript/tab_applescript.h"
12 #import "chrome/browser/cocoa/applescript/window_applescript.h" 14 #import "chrome/browser/cocoa/applescript/window_applescript.h"
13 #include "chrome/browser/profile.h" 15 #include "chrome/browser/profile.h"
14 #include "chrome/test/in_process_browser_test.h" 16 #include "chrome/test/in_process_browser_test.h"
(...skipping 20 matching lines...) Expand all
35 EXPECT_FALSE(aWindow.get()); 37 EXPECT_FALSE(aWindow.get());
36 } 38 }
37 39
38 // Create a window with a particular profile. 40 // Create a window with a particular profile.
39 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithProfile) { 41 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithProfile) {
40 Profile* defaultProfile = [[NSApp delegate] defaultProfile]; 42 Profile* defaultProfile = [[NSApp delegate] defaultProfile];
41 scoped_nsobject<WindowAppleScript> aWindow( 43 scoped_nsobject<WindowAppleScript> aWindow(
42 [[WindowAppleScript alloc] initWithProfile:defaultProfile]); 44 [[WindowAppleScript alloc] initWithProfile:defaultProfile]);
43 EXPECT_TRUE(aWindow.get()); 45 EXPECT_TRUE(aWindow.get());
44 EXPECT_TRUE([aWindow.get() uniqueID]); 46 EXPECT_TRUE([aWindow.get() uniqueID]);
45 EXPECT_EQ([aWindow.get() container],
46 [BrowserCrApplication sharedApplication]);
47 EXPECT_NSEQ(AppleScript::kWindowsProperty,
48 [aWindow.get() containerProperty]);
49 } 47 }
50 48
51 // Create a window with no |Browser*|. 49 // Create a window with no |Browser*|.
52 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithNoBrowser) { 50 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithNoBrowser) {
53 scoped_nsobject<WindowAppleScript> aWindow( 51 scoped_nsobject<WindowAppleScript> aWindow(
54 [[WindowAppleScript alloc] initWithBrowser:NULL]); 52 [[WindowAppleScript alloc] initWithBrowser:NULL]);
55 EXPECT_FALSE(aWindow.get()); 53 EXPECT_FALSE(aWindow.get());
56 } 54 }
57 55
58 // Create a window with |Browser*| already present. 56 // Create a window with |Browser*| already present.
59 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithBrowser) { 57 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithBrowser) {
60 scoped_nsobject<WindowAppleScript> aWindow( 58 scoped_nsobject<WindowAppleScript> aWindow(
61 [[WindowAppleScript alloc] initWithBrowser:browser()]); 59 [[WindowAppleScript alloc] initWithBrowser:browser()]);
62 EXPECT_TRUE(aWindow.get()); 60 EXPECT_TRUE(aWindow.get());
63 EXPECT_TRUE([aWindow.get() uniqueID]); 61 EXPECT_TRUE([aWindow.get() uniqueID]);
64 EXPECT_EQ([aWindow.get() container],
65 [BrowserCrApplication sharedApplication]);
66 EXPECT_NSEQ(AppleScript::kWindowsProperty,
67 [aWindow.get() containerProperty]);
68 } 62 }
69 63
70 // Tabs within the window. 64 // Tabs within the window.
71 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, Tabs) { 65 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, Tabs) {
72 scoped_nsobject<WindowAppleScript> aWindow( 66 scoped_nsobject<WindowAppleScript> aWindow(
73 [[WindowAppleScript alloc] initWithBrowser:browser()]); 67 [[WindowAppleScript alloc] initWithBrowser:browser()]);
74 NSArray* tabs = [aWindow.get() tabs]; 68 NSArray* tabs = [aWindow.get() tabs];
75 EXPECT_EQ(1U, [tabs count]); 69 EXPECT_EQ(1U, [tabs count]);
76 TabAppleScript* tab1 = [tabs objectAtIndex:0]; 70 TabAppleScript* tab1 = [tabs objectAtIndex:0];
77 EXPECT_EQ([tab1 container], aWindow.get()); 71 EXPECT_EQ([tab1 container], aWindow.get());
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // Order of windows. 158 // Order of windows.
165 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, WindowOrder) { 159 IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, WindowOrder) {
166 scoped_nsobject<WindowAppleScript> window2( 160 scoped_nsobject<WindowAppleScript> window2(
167 [[WindowAppleScript alloc] initWithBrowser:browser()]); 161 [[WindowAppleScript alloc] initWithBrowser:browser()]);
168 scoped_nsobject<WindowAppleScript> window1( 162 scoped_nsobject<WindowAppleScript> window1(
169 [[WindowAppleScript alloc] init]); 163 [[WindowAppleScript alloc] init]);
170 EXPECT_EQ([window1.get() windowComparator:window2.get()], NSOrderedAscending); 164 EXPECT_EQ([window1.get() windowComparator:window2.get()], NSOrderedAscending);
171 EXPECT_EQ([window2.get() windowComparator:window1.get()], 165 EXPECT_EQ([window2.get() windowComparator:window1.get()],
172 NSOrderedDescending); 166 NSOrderedDescending);
173 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/applescript/window_applescript.mm ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698