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

Unified Diff: chrome/browser/cocoa/applescript/window_applescript_test.mm

Issue 3180006: Cleaned up the SDEF... (Closed) Base URL: http://src.chromium.org/svn/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/applescript/tab_applescript.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/applescript/window_applescript_test.mm
===================================================================
--- chrome/browser/cocoa/applescript/window_applescript_test.mm (revision 56204)
+++ chrome/browser/cocoa/applescript/window_applescript_test.mm (working copy)
@@ -76,33 +76,44 @@
// Insert a new tab.
IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, InsertTab) {
// Emulate what applescript would do when creating a new tab.
+ // Emulates a script like |set var to make new tab with
+ // properties URL:"http://google.com"}|.
scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]);
+ scoped_nsobject<NSNumber> var([[aTab.get() uniqueID] copy]);
[aTab.get() setURL:@"http://google.com"];
scoped_nsobject<WindowAppleScript> aWindow(
[[WindowAppleScript alloc] initWithBrowser:browser()]);
[aWindow.get() insertInTabs:aTab.get()];
- EXPECT_EQ([aTab.get() container], aWindow.get());
+
+ // Represents the tab after it is inserted.
+ TabAppleScript* tab = [[aWindow.get() tabs] objectAtIndex:1];
+ EXPECT_EQ(GURL("http://google.com"),
+ GURL(base::SysNSStringToUTF8([tab URL])));
+ EXPECT_EQ([tab container], aWindow.get());
EXPECT_NSEQ(AppleScript::kTabsProperty,
- [aTab.get() containerProperty]);
- TabAppleScript* tab2 = [[aWindow.get() tabs] objectAtIndex:1];
- EXPECT_EQ(GURL("http://google.com"),
- GURL(base::SysNSStringToUTF8([tab2 URL])));
+ [tab containerProperty]);
+ EXPECT_NSEQ(var.get(), [tab uniqueID]);
}
// Insert a new tab at a particular position
IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, InsertTabAtPosition) {
- scoped_nsobject<TabAppleScript> tab1([[TabAppleScript alloc] init]);
- scoped_nsobject<TabAppleScript> tab2([[TabAppleScript alloc] init]);
+ // Emulate what applescript would do when creating a new tab.
+ // Emulates a script like |set var to make new tab with
+ // properties URL:"http://google.com"} at before tab 1|.
+ scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]);
+ scoped_nsobject<NSNumber> var([[aTab.get() uniqueID] copy]);
+ [aTab.get() setURL:@"http://google.com"];
scoped_nsobject<WindowAppleScript> aWindow(
[[WindowAppleScript alloc] initWithBrowser:browser()]);
- [aWindow.get() insertInTabs:tab1.get()];
- [aWindow.get() insertInTabs:tab2.get()];
+ [aWindow.get() insertInTabs:aTab.get() atIndex:0];
- scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]);
- [aWindow.get() insertInTabs:aTab.get() atIndex:1];
- TabAppleScript* tab = [[aWindow.get() tabs] objectAtIndex:1];
- EXPECT_NSEQ([aTab.get() uniqueID],
- [tab uniqueID]);
+ // Represents the tab after it is inserted.
+ TabAppleScript* tab = [[aWindow.get() tabs] objectAtIndex:0];
+ EXPECT_EQ(GURL("http://google.com"),
+ GURL(base::SysNSStringToUTF8([tab URL])));
+ EXPECT_EQ([tab container], aWindow.get());
+ EXPECT_NSEQ(AppleScript::kTabsProperty, [tab containerProperty]);
+ EXPECT_NSEQ(var.get(), [tab uniqueID]);
}
// Inserting and deleting tabs.
« no previous file with comments | « chrome/browser/cocoa/applescript/tab_applescript.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698