summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui
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
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')
-rw-r--r--chrome/test/ui/ui_test.cc10
-rw-r--r--chrome/test/ui/ui_test.h3
2 files changed, 13 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);
}
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 3b37b98..e3a7c79 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -103,6 +103,9 @@ class UITest : public testing::Test {
// Returns the title of the currently active tab.
std::wstring GetActiveTabTitle();
+ // Returns the tabstrip index of the currently active tab, or -1 on error.
+ int GetActiveTabIndex();
+
// Returns true when the browser process is running, independent if any
// renderer process exists or not. It will returns false if an user closed the
// window or if the browser process died by itself.