| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 translate_prefs.ResetTranslationAcceptedCount("de"); | 1324 translate_prefs.ResetTranslationAcceptedCount("de"); |
| 1325 translate_prefs.ResetTranslationDeniedCount("de"); | 1325 translate_prefs.ResetTranslationDeniedCount("de"); |
| 1326 | 1326 |
| 1327 // We'll do 4 times in incognito mode first to make sure the button is not | 1327 // We'll do 4 times in incognito mode first to make sure the button is not |
| 1328 // shown in that case, then 4 times in normal mode. | 1328 // shown in that case, then 4 times in normal mode. |
| 1329 TranslateInfoBarDelegate* infobar; | 1329 TranslateInfoBarDelegate* infobar; |
| 1330 TestingProfile* test_profile = | 1330 TestingProfile* test_profile = |
| 1331 static_cast<TestingProfile*>(web_contents()->GetBrowserContext()); | 1331 static_cast<TestingProfile*>(web_contents()->GetBrowserContext()); |
| 1332 static_cast<extensions::TestExtensionSystem*>( | 1332 static_cast<extensions::TestExtensionSystem*>( |
| 1333 extensions::ExtensionSystem::Get(test_profile))-> | 1333 extensions::ExtensionSystem::Get(test_profile))-> |
| 1334 CreateExtensionProcessManager(); | 1334 CreateProcessManager(); |
| 1335 test_profile->ForceIncognito(true); | 1335 test_profile->ForceIncognito(true); |
| 1336 for (int i = 0; i < 8; ++i) { | 1336 for (int i = 0; i < 8; ++i) { |
| 1337 SCOPED_TRACE(::testing::Message() << "Iteration " << i << | 1337 SCOPED_TRACE(::testing::Message() << "Iteration " << i << |
| 1338 " incognito mode=" << test_profile->IsOffTheRecord()); | 1338 " incognito mode=" << test_profile->IsOffTheRecord()); |
| 1339 SimulateNavigation(GURL("http://www.google.fr"), "fr", true); | 1339 SimulateNavigation(GURL("http://www.google.fr"), "fr", true); |
| 1340 infobar = GetTranslateInfoBar(); | 1340 infobar = GetTranslateInfoBar(); |
| 1341 ASSERT_TRUE(infobar != NULL); | 1341 ASSERT_TRUE(infobar != NULL); |
| 1342 EXPECT_EQ(TranslateInfoBarDelegate::BEFORE_TRANSLATE, | 1342 EXPECT_EQ(TranslateInfoBarDelegate::BEFORE_TRANSLATE, |
| 1343 infobar->infobar_type()); | 1343 infobar->infobar_type()); |
| 1344 if (i < 7) { | 1344 if (i < 7) { |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 content::WebContents* current_web_contents = | 1604 content::WebContents* current_web_contents = |
| 1605 browser()->tab_strip_model()->GetActiveWebContents(); | 1605 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1606 content::Source<content::WebContents> source(current_web_contents); | 1606 content::Source<content::WebContents> source(current_web_contents); |
| 1607 | 1607 |
| 1608 ui_test_utils::WindowedNotificationObserverWithDetails< | 1608 ui_test_utils::WindowedNotificationObserverWithDetails< |
| 1609 LanguageDetectionDetails> | 1609 LanguageDetectionDetails> |
| 1610 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, | 1610 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, |
| 1611 source); | 1611 source); |
| 1612 fr_language_detected_signal.Wait(); | 1612 fr_language_detected_signal.Wait(); |
| 1613 } | 1613 } |
| OLD | NEW |