OLD | NEW |
1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "app/keyboard_code_conversion.h" | 8 #include "app/keyboard_code_conversion.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 | 103 |
104 virtual void SetUp() { | 104 virtual void SetUp() { |
105 URLFetcher::set_factory(&url_fetcher_factory_); | 105 URLFetcher::set_factory(&url_fetcher_factory_); |
106 InProcessBrowserTest::SetUp(); | 106 InProcessBrowserTest::SetUp(); |
107 } | 107 } |
108 | 108 |
109 void SimulateURLFetch(bool success) { | 109 void SimulateURLFetch(bool success) { |
110 TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); | 110 TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); |
111 ASSERT_TRUE(fetcher); | 111 ASSERT_TRUE(fetcher); |
112 URLRequestStatus status; | 112 net::URLRequestStatus status; |
113 status.set_status(success ? URLRequestStatus::SUCCESS : | 113 status.set_status(success ? net::URLRequestStatus::SUCCESS : |
114 URLRequestStatus::FAILED); | 114 net::URLRequestStatus::FAILED); |
115 | 115 |
116 std::string script = " var google = {};" | 116 std::string script = " var google = {};" |
117 "google.translate = (function() {" | 117 "google.translate = (function() {" |
118 " return {" | 118 " return {" |
119 " TranslateService: function() {" | 119 " TranslateService: function() {" |
120 " return {" | 120 " return {" |
121 " isAvailable : function() {" | 121 " isAvailable : function() {" |
122 " return true;" | 122 " return true;" |
123 " }," | 123 " }," |
124 " restore : function() {" | 124 " restore : function() {" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // But right now, the call stucks here. | 277 // But right now, the call stucks here. |
278 // Once click the text field, it starts again. | 278 // Once click the text field, it starts again. |
279 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 279 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
280 rvh(), L"", L"cr.googleTranslate.onTranslateElementLoad();")); | 280 rvh(), L"", L"cr.googleTranslate.onTranslateElementLoad();")); |
281 | 281 |
282 // Simulate the render notifying the translation has been done. | 282 // Simulate the render notifying the translation has been done. |
283 ui_test_utils::WaitForNotification(NotificationType::PAGE_TRANSLATED); | 283 ui_test_utils::WaitForNotification(NotificationType::PAGE_TRANSLATED); |
284 | 284 |
285 TryBasicFormFillWithMKey(); | 285 TryBasicFormFillWithMKey(); |
286 } | 286 } |
OLD | NEW |