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

Unified Diff: chrome/test/functional/close_tab.py

Issue 7748032: Close last tab test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/close_tab.py
diff --git a/chrome/test/functional/close_tab.py b/chrome/test/functional/close_tab.py
new file mode 100755
index 0000000000000000000000000000000000000000..9ee468874f3384db52c914c1009585843d2c6db2
--- /dev/null
+++ b/chrome/test/functional/close_tab.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python
dennis_jeffrey 2011/08/25 23:09:20 Since it looks like this test is chromeos-specific
tturchetto 2011/08/26 00:49:38 Renamed the file to chromeos_browser.py On 2011/0
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import pyauto_functional
dennis_jeffrey 2011/08/25 23:09:20 I recommend adding a comment saying that this impo
tturchetto 2011/08/26 00:49:38 Done.
+import pyauto
+
+
+class CloseTab(pyauto.PyUITest):
+ """Close last tab test for ChromeOS.
dennis_jeffrey 2011/08/25 23:09:20 Although there's only 1 test in this class right n
tturchetto 2011/08/26 00:49:38 Done.
+
+ Requires ChromeOS to be logged in.
+ """
+
+ def testCloseAllTabs(self):
+ """Close all tabs. There should be 1 tab open on Chrome OS"""
dennis_jeffrey 2011/08/25 23:09:20 "Closes all tabs and verifies 1 tab is still open
tturchetto 2011/08/26 00:49:38 Done.
+ tab_count = self.GetTabCount()
+
+ for tab_index in xrange(tab_count - 1, -1, -1):
dennis_jeffrey 2011/08/25 23:09:20 how about using xrange(tab_count, 0, -1)? It seem
tturchetto 2011/08/26 00:49:38 this will give error message, therefore, I keep th
+ self.GetBrowserWindow(0).GetTab(tab_index).Close(True)
+
+ info = self.GetBrowserInfo()
+ self.assertEqual(1, len(info['windows'])) # one window
dennis_jeffrey 2011/08/25 23:09:20 I think the comment is not necessary; it's easy to
tturchetto 2011/08/26 00:49:38 Done.
+ self.assertEqual(1, len(info['windows'][0]['tabs'])) # one tab
dennis_jeffrey 2011/08/25 23:09:20 I think the comment is not necessary; it's easy to
tturchetto 2011/08/26 00:49:38 Done.
+ self.assertEqual('chrome://newtab/',
+ info['windows'][0]['tabs'][0]['url']) # empty URL
dennis_jeffrey 2011/08/25 23:09:20 I think the comment is not necessary, but it also
dennis_jeffrey 2011/08/25 23:09:20 For each of the 3 assertions above, you may want t
tturchetto 2011/08/26 00:49:38 Done.
tturchetto 2011/08/26 00:49:38 Done.
+
dennis_jeffrey 2011/08/25 23:09:20 Add 1 more blank line here.
tturchetto 2011/08/26 00:49:38 Done.
+if __name__ == '__main__':
+ pyauto_functional.Main()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698