| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import <XCTest/XCTest.h> | 5 #import <XCTest/XCTest.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/mac/bind_objc_block.h" | 8 #include "base/mac/bind_objc_block.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 [self simulateTranslationFromSpanishToEnglish]; | 720 [self simulateTranslationFromSpanishToEnglish]; |
| 721 // Check that the infobar does not contain the "Always Translate" switch. | 721 // Check that the infobar does not contain the "Always Translate" switch. |
| 722 NSString* switchLabel = GetTranslateInfobarSwitchLabel("Spanish"); | 722 NSString* switchLabel = GetTranslateInfobarSwitchLabel("Spanish"); |
| 723 [[EarlGrey | 723 [[EarlGrey |
| 724 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabel( | 724 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabel( |
| 725 switchLabel)] assertWithMatcher:grey_nil()]; | 725 switchLabel)] assertWithMatcher:grey_nil()]; |
| 726 } | 726 } |
| 727 | 727 |
| 728 // Tests that translation occurs automatically on second navigation to an | 728 // Tests that translation occurs automatically on second navigation to an |
| 729 // already translated page. | 729 // already translated page. |
| 730 - (void)testAutoTranslate { | 730 // TODO(crbug.com/732797): Reenable this test. |
| 731 - (void)DISABLED_testAutoTranslate { |
| 731 // The translate machinery will not auto-fire without API keys, unless that | 732 // The translate machinery will not auto-fire without API keys, unless that |
| 732 // behavior is overridden for testing. | 733 // behavior is overridden for testing. |
| 733 translate::TranslateManager::SetIgnoreMissingKeyForTesting(true); | 734 translate::TranslateManager::SetIgnoreMissingKeyForTesting(true); |
| 734 | 735 |
| 735 std::unique_ptr<web::DataResponseProvider> provider(new TestResponseProvider); | 736 std::unique_ptr<web::DataResponseProvider> provider(new TestResponseProvider); |
| 736 web::test::SetUpHttpServer(std::move(provider)); | 737 web::test::SetUpHttpServer(std::move(provider)); |
| 737 | 738 |
| 738 // Reset translate prefs to default. | 739 // Reset translate prefs to default. |
| 739 std::unique_ptr<translate::TranslatePrefs> translatePrefs( | 740 std::unique_ptr<translate::TranslatePrefs> translatePrefs( |
| 740 ChromeIOSTranslateClient::CreateTranslatePrefs( | 741 ChromeIOSTranslateClient::CreateTranslatePrefs( |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 [[EarlGrey | 847 [[EarlGrey |
| 847 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( | 848 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( |
| 848 IDS_TRANSLATE_INFOBAR_REVERT)] | 849 IDS_TRANSLATE_INFOBAR_REVERT)] |
| 849 assertWithMatcher:grey_notNil()]; | 850 assertWithMatcher:grey_notNil()]; |
| 850 [[EarlGrey | 851 [[EarlGrey |
| 851 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( | 852 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( |
| 852 IDS_CLOSE)] assertWithMatcher:grey_notNil()]; | 853 IDS_CLOSE)] assertWithMatcher:grey_notNil()]; |
| 853 } | 854 } |
| 854 | 855 |
| 855 @end | 856 @end |
| OLD | NEW |