| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
| 6 #include "base/string_number_conversions.h" | 6 #include "base/string_number_conversions.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/test/automation/dom_element_proxy.h" | 8 #include "chrome/test/automation/dom_element_proxy.h" |
| 9 #include "chrome/test/automation/javascript_execution_controller.h" | 9 #include "chrome/test/automation/javascript_execution_controller.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 if (!proxy->DoesAttributeEventuallyMatch(attribute, new_value)) | 49 if (!proxy->DoesAttributeEventuallyMatch(attribute, new_value)) |
| 50 FAIL() << "Executing or parsing JavaScript failed"; | 50 FAIL() << "Executing or parsing JavaScript failed"; |
| 51 } | 51 } |
| 52 | 52 |
| 53 // Tests the DOMAutomation framework for manipulating DOMElements within | 53 // Tests the DOMAutomation framework for manipulating DOMElements within |
| 54 // browser tests. | 54 // browser tests. |
| 55 class DOMAutomationTest : public InProcessBrowserTest { | 55 class DOMAutomationTest : public InProcessBrowserTest { |
| 56 public: | 56 public: |
| 57 DOMAutomationTest() { | 57 DOMAutomationTest() { |
| 58 EnableDOMAutomation(); | 58 EnableDOMAutomation(); |
| 59 JavaScriptExecutionController::set_timeout(30000); | 59 JavaScriptExecutionController::set_timeout( |
| 60 base::TimeDelta::FromSeconds(30)); |
| 60 } | 61 } |
| 61 | 62 |
| 62 GURL GetTestURL(const char* path) { | 63 GURL GetTestURL(const char* path) { |
| 63 std::string url_path = "files/dom_automation/"; | 64 std::string url_path = "files/dom_automation/"; |
| 64 url_path.append(path); | 65 url_path.append(path); |
| 65 return test_server()->GetURL(url_path); | 66 return test_server()->GetURL(url_path); |
| 66 } | 67 } |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 typedef DOMElementProxy::By By; | 70 typedef DOMElementProxy::By By; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 L"' \"" | 337 L"' \"" |
| 337 }; | 338 }; |
| 338 for (size_t i = 0; i < 3; i++) { | 339 for (size_t i = 0; i < 3; i++) { |
| 339 ASSERT_TRUE(textarea->SetText(WideToUTF8(set_and_expect_strings[i]))); | 340 ASSERT_TRUE(textarea->SetText(WideToUTF8(set_and_expect_strings[i]))); |
| 340 ASSERT_NO_FATAL_FAILURE(EnsureTextMatches( | 341 ASSERT_NO_FATAL_FAILURE(EnsureTextMatches( |
| 341 textarea, WideToUTF8(set_and_expect_strings[i]))); | 342 textarea, WideToUTF8(set_and_expect_strings[i]))); |
| 342 } | 343 } |
| 343 } | 344 } |
| 344 | 345 |
| 345 } // namespace | 346 } // namespace |
| OLD | NEW |