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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 " <option value=\"CA\">Canada</option>" | 683 " <option value=\"CA\">Canada</option>" |
684 " <option value=\"US\">United States</option>" | 684 " <option value=\"US\">United States</option>" |
685 " </select><br>" | 685 " </select><br>" |
686 "<label for=\"ph\">Phone number:</label>" | 686 "<label for=\"ph\">Phone number:</label>" |
687 " <input type=\"text\" id=\"ph\"><br>" | 687 " <input type=\"text\" id=\"ph\"><br>" |
688 "</form>"); | 688 "</form>"); |
689 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 689 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
690 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL(browser(), url)); | 690 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL(browser(), url)); |
691 | 691 |
692 // Get translation bar. | 692 // Get translation bar. |
693 render_view_host()->OnMessageReceived( | 693 render_view_host()->OnMessageReceivedForTesting( |
694 ChromeViewHostMsg_TranslateLanguageDetermined(0, "ja", true)); | 694 ChromeViewHostMsg_TranslateLanguageDetermined(0, "ja", true)); |
695 TranslateInfoBarDelegate* infobar = | 695 TranslateInfoBarDelegate* infobar = |
696 browser()->GetSelectedTabContentsWrapper()->infobar_tab_helper()-> | 696 browser()->GetSelectedTabContentsWrapper()->infobar_tab_helper()-> |
697 GetInfoBarDelegateAt(0)->AsTranslateInfoBarDelegate(); | 697 GetInfoBarDelegateAt(0)->AsTranslateInfoBarDelegate(); |
698 | 698 |
699 ASSERT_TRUE(infobar != NULL); | 699 ASSERT_TRUE(infobar != NULL); |
700 EXPECT_EQ(TranslateInfoBarDelegate::BEFORE_TRANSLATE, infobar->type()); | 700 EXPECT_EQ(TranslateInfoBarDelegate::BEFORE_TRANSLATE, infobar->type()); |
701 | 701 |
702 // Simulate translation button press. | 702 // Simulate translation button press. |
703 infobar->Translate(); | 703 infobar->Translate(); |
(...skipping 11 matching lines...) Expand all Loading... |
715 // Once click the text field, it starts again. | 715 // Once click the text field, it starts again. |
716 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 716 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
717 render_view_host(), L"", | 717 render_view_host(), L"", |
718 L"cr.googleTranslate.onTranslateElementLoad();")); | 718 L"cr.googleTranslate.onTranslateElementLoad();")); |
719 | 719 |
720 // Simulate the render notifying the translation has been done. | 720 // Simulate the render notifying the translation has been done. |
721 translation_observer.Wait(); | 721 translation_observer.Wait(); |
722 | 722 |
723 TryBasicFormFill(); | 723 TryBasicFormFill(); |
724 } | 724 } |
OLD | NEW |