summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui/ui_test.cc
diff options
context:
space:
mode:
authorpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 22:01:03 +0000
committerpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 22:01:03 +0000
commit77bc673bf31c32bfdcb1bf139c3a58eace23e3ea (patch)
treea737cc649d4f38a2b96ca2de8d1da4fda0e36451 /chrome/test/ui/ui_test.cc
parent8c2ea0e34721a2b0bfd8e003937b0617adfddf96 (diff)
downloadchromium_src-77bc673bf31c32bfdcb1bf139c3a58eace23e3ea.zip
chromium_src-77bc673bf31c32bfdcb1bf139c3a58eace23e3ea.tar.gz
chromium_src-77bc673bf31c32bfdcb1bf139c3a58eace23e3ea.tar.bz2
When restoring a closed tab using either ctrl-shift-T or the context menu, put
it back into the window it came from, at the tabstrip index it occupied before, and activate (select) both the window and the tab. Restoring a tab from the New Tab Page replaces the NTP, as before. If the window the tab was in no longer exists, put the tab at the end of the current window's tabstrip. This behavior may change in a later patch. BUG=5278 TEST=Open two windows, with >1 tabs each. Close a tab, not the one at the end, in one of the windows. Switch to the other window and choose "Undo Closed Tab" from the tabstrip context menu, or type ctrl-shift-T. The tab should be restored where it was, and activated (selected and brought to the front). Review URL: http://codereview.chromium.org/69015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui/ui_test.cc')
-rw-r--r--chrome/test/ui/ui_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index ddea594..620637e 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -566,6 +566,16 @@ std::wstring UITest::GetActiveTabTitle() {
return title;
}
+int UITest::GetActiveTabIndex() {
+ scoped_ptr<TabProxy> tab_proxy(GetActiveTab());
+ if (!tab_proxy.get())
+ return -1;
+
+ int index;
+ EXPECT_TRUE(tab_proxy->GetTabIndex(&index));
+ return index;
+}
+
bool UITest::IsBrowserRunning() {
return CrashAwareSleep(0);
}