| 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 | 5 |
| 6 #include <algorithm> | 6 #include <algorithm> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // ChromeRenderViewHostTestHarness::SetUp() to match what's done in Chrome, | 228 // ChromeRenderViewHostTestHarness::SetUp() to match what's done in Chrome, |
| 229 // where the TranslateManager is created before the WebContents. This | 229 // where the TranslateManager is created before the WebContents. This |
| 230 // matters as they both register for similar events and we want the | 230 // matters as they both register for similar events and we want the |
| 231 // notifications to happen in the same sequence (TranslateManager first, | 231 // notifications to happen in the same sequence (TranslateManager first, |
| 232 // WebContents second). Also clears the translate script so it is fetched | 232 // WebContents second). Also clears the translate script so it is fetched |
| 233 // everytime and sets the expiration delay to a large value by default (in | 233 // everytime and sets the expiration delay to a large value by default (in |
| 234 // case it was zeroed in a previous test). | 234 // case it was zeroed in a previous test). |
| 235 TranslateManager::GetInstance()->ClearTranslateScript(); | 235 TranslateManager::GetInstance()->ClearTranslateScript(); |
| 236 TranslateManager::GetInstance()-> | 236 TranslateManager::GetInstance()-> |
| 237 set_translate_script_expiration_delay(60 * 60 * 1000); | 237 set_translate_script_expiration_delay(60 * 60 * 1000); |
| 238 TranslateManager::GetInstance()->set_translate_max_reload_attemps(0); |
| 238 | 239 |
| 239 ChromeRenderViewHostTestHarness::SetUp(); | 240 ChromeRenderViewHostTestHarness::SetUp(); |
| 240 InfoBarService::CreateForWebContents(web_contents()); | 241 InfoBarService::CreateForWebContents(web_contents()); |
| 241 TranslateTabHelper::CreateForWebContents(web_contents()); | 242 TranslateTabHelper::CreateForWebContents(web_contents()); |
| 242 | 243 |
| 243 notification_registrar_.Add(this, | 244 notification_registrar_.Add(this, |
| 244 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 245 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 245 content::Source<InfoBarService>(infobar_service())); | 246 content::Source<InfoBarService>(infobar_service())); |
| 246 } | 247 } |
| 247 | 248 |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1515 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, MAYBE_TranslateSessionRestore) { | 1516 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, MAYBE_TranslateSessionRestore) { |
| 1516 WebContents* current_web_contents = | 1517 WebContents* current_web_contents = |
| 1517 browser()->tab_strip_model()->GetActiveWebContents(); | 1518 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1518 content::Source<WebContents> source(current_web_contents); | 1519 content::Source<WebContents> source(current_web_contents); |
| 1519 | 1520 |
| 1520 ui_test_utils::WindowedNotificationObserverWithDetails<std::string> | 1521 ui_test_utils::WindowedNotificationObserverWithDetails<std::string> |
| 1521 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, | 1522 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, |
| 1522 source); | 1523 source); |
| 1523 fr_language_detected_signal.Wait(); | 1524 fr_language_detected_signal.Wait(); |
| 1524 } | 1525 } |
| OLD | NEW |