OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/string16.h" | 6 #include "base/string16.h" |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 OptionsUITest() { | 25 OptionsUITest() { |
26 dom_automation_enabled_ = true; | 26 dom_automation_enabled_ = true; |
27 } | 27 } |
28 | 28 |
29 bool WaitForOptionsUI(TabProxy* tab) { | 29 bool WaitForOptionsUI(TabProxy* tab) { |
30 return WaitUntilJavaScriptCondition(tab, L"", | 30 return WaitUntilJavaScriptCondition(tab, L"", |
31 L"domAutomationController.send(" | 31 L"domAutomationController.send(" |
32 L" location.protocol == 'chrome:' && " | 32 L" location.protocol == 'chrome:' && " |
33 L" document.readyState == 'complete')", | 33 L" document.readyState == 'complete')", |
34 TestTimeouts::huge_test_timeout_ms()); | 34 TestTimeouts::large_test_timeout_ms()); |
35 } | 35 } |
36 | 36 |
37 scoped_refptr<TabProxy> GetOptionsUITab() { | 37 scoped_refptr<TabProxy> GetOptionsUITab() { |
38 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 38 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
39 EXPECT_TRUE(browser.get()); | 39 EXPECT_TRUE(browser.get()); |
40 if (!browser.get()) | 40 if (!browser.get()) |
41 return NULL; | 41 return NULL; |
42 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); | 42 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); |
43 EXPECT_TRUE(tab.get()); | 43 EXPECT_TRUE(tab.get()); |
44 if (!tab.get()) | 44 if (!tab.get()) |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 const int kExpectedSections = 1 + 3; | 159 const int kExpectedSections = 1 + 3; |
160 #endif | 160 #endif |
161 int num_of_sections = 0; | 161 int num_of_sections = 0; |
162 ASSERT_TRUE(tab->ExecuteAndExtractInt(L"", | 162 ASSERT_TRUE(tab->ExecuteAndExtractInt(L"", |
163 L"domAutomationController.send(" | 163 L"domAutomationController.send(" |
164 L"document.getElementById('navbar').children.length)", &num_of_sections)); | 164 L"document.getElementById('navbar').children.length)", &num_of_sections)); |
165 ASSERT_EQ(kExpectedSections, num_of_sections); | 165 ASSERT_EQ(kExpectedSections, num_of_sections); |
166 } | 166 } |
167 | 167 |
168 } // namespace | 168 } // namespace |
OLD | NEW |