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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 | 531 |
532 // Let's run the same steps again but this time the server fails to detect the | 532 // Let's run the same steps again but this time the server fails to detect the |
533 // page's language (it returns an empty string). | 533 // page's language (it returns an empty string). |
534 SimulateNavigation(GURL("http://www.google.com"), "und", true); | 534 SimulateNavigation(GURL("http://www.google.com"), "und", true); |
535 menu.reset(TestRenderViewContextMenu::CreateContextMenu(web_contents())); | 535 menu.reset(TestRenderViewContextMenu::CreateContextMenu(web_contents())); |
536 menu->Init(); | 536 menu->Init(); |
537 menu->ExecuteCommand(IDC_CONTENT_CONTEXT_TRANSLATE, 0); | 537 menu->ExecuteCommand(IDC_CONTENT_CONTEXT_TRANSLATE, 0); |
538 RenderViewHostTester::TestOnMessageReceived( | 538 RenderViewHostTester::TestOnMessageReceived( |
539 rvh(), | 539 rvh(), |
540 ChromeViewHostMsg_PageTranslated( | 540 ChromeViewHostMsg_PageTranslated( |
541 2, 0, "", "en", TranslateErrors::UNKNOWN_LANGUAGE)); | 541 2, 0, std::string(), "en", TranslateErrors::UNKNOWN_LANGUAGE)); |
542 infobar = GetTranslateInfoBar(); | 542 infobar = GetTranslateInfoBar(); |
543 ASSERT_TRUE(infobar != NULL); | 543 ASSERT_TRUE(infobar != NULL); |
544 EXPECT_EQ(TranslateInfoBarDelegate::TRANSLATION_ERROR, | 544 EXPECT_EQ(TranslateInfoBarDelegate::TRANSLATION_ERROR, |
545 infobar->infobar_type()); | 545 infobar->infobar_type()); |
546 EXPECT_EQ(TranslateErrors::UNKNOWN_LANGUAGE, infobar->error_type()); | 546 EXPECT_EQ(TranslateErrors::UNKNOWN_LANGUAGE, infobar->error_type()); |
547 } | 547 } |
548 | 548 |
549 // Tests that we show/don't show an info-bar for all languages the CLD can | 549 // Tests that we show/don't show an info-bar for all languages the CLD can |
550 // report. | 550 // report. |
551 TEST_F(TranslateManagerBrowserTest, TestAllLanguages) { | 551 TEST_F(TranslateManagerBrowserTest, TestAllLanguages) { |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, MAYBE_TranslateSessionRestore) { | 1516 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, MAYBE_TranslateSessionRestore) { |
1517 WebContents* current_web_contents = | 1517 WebContents* current_web_contents = |
1518 browser()->tab_strip_model()->GetActiveWebContents(); | 1518 browser()->tab_strip_model()->GetActiveWebContents(); |
1519 content::Source<WebContents> source(current_web_contents); | 1519 content::Source<WebContents> source(current_web_contents); |
1520 | 1520 |
1521 ui_test_utils::WindowedNotificationObserverWithDetails<std::string> | 1521 ui_test_utils::WindowedNotificationObserverWithDetails<std::string> |
1522 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, | 1522 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, |
1523 source); | 1523 source); |
1524 fr_language_detected_signal.Wait(); | 1524 fr_language_detected_signal.Wait(); |
1525 } | 1525 } |
OLD | NEW |