| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 }; // namespace | 47 }; // namespace |
| 48 | 48 |
| 49 class TranslateBrowserTest : public InProcessBrowserTest { | 49 class TranslateBrowserTest : public InProcessBrowserTest { |
| 50 public: | 50 public: |
| 51 TranslateBrowserTest() | 51 TranslateBrowserTest() |
| 52 : https_server_(net::SpawnedTestServer::TYPE_HTTPS, | 52 : https_server_(net::SpawnedTestServer::TYPE_HTTPS, |
| 53 SSLOptions(SSLOptions::CERT_OK), | 53 SSLOptions(SSLOptions::CERT_OK), |
| 54 base::FilePath(kTranslateRoot)), | 54 base::FilePath(kTranslateRoot)), |
| 55 infobar_service_(NULL) {} | 55 infobar_service_(NULL) {} |
| 56 | 56 |
| 57 void SetUp() override { |
| 58 translate::TranslateManager::SetIgnoreMissingKeyForTesting(true); |
| 59 InProcessBrowserTest::SetUp(); |
| 60 } |
| 61 |
| 57 void SetUpCommandLine(base::CommandLine* command_line) override { | 62 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 58 ASSERT_TRUE(https_server_.Start()); | 63 ASSERT_TRUE(https_server_.Start()); |
| 59 // Setup alternate security origin for testing in order to allow XHR against | 64 // Setup alternate security origin for testing in order to allow XHR against |
| 60 // local test server. Note that this flag shows a confirm infobar in tests. | 65 // local test server. Note that this flag shows a confirm infobar in tests. |
| 61 GURL base_url = GetSecureURL(""); | 66 GURL base_url = GetSecureURL(""); |
| 62 command_line->AppendSwitchASCII( | 67 command_line->AppendSwitchASCII( |
| 63 translate::switches::kTranslateSecurityOrigin, | 68 translate::switches::kTranslateSecurityOrigin, |
| 64 base_url.GetOrigin().spec()); | 69 base_url.GetOrigin().spec()); |
| 65 } | 70 } |
| 66 | 71 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 GetNonSecureURL(kUpdateLocationAtOnloadTestPath)); | 352 GetNonSecureURL(kUpdateLocationAtOnloadTestPath)); |
| 348 | 353 |
| 349 // Wait for the page title is changed after the test finished. | 354 // Wait for the page title is changed after the test finished. |
| 350 const base::string16 result = watcher.WaitAndGetTitle(); | 355 const base::string16 result = watcher.WaitAndGetTitle(); |
| 351 EXPECT_EQ("PASS", base::UTF16ToASCII(result)); | 356 EXPECT_EQ("PASS", base::UTF16ToASCII(result)); |
| 352 | 357 |
| 353 // Check if there is no Translate infobar. | 358 // Check if there is no Translate infobar. |
| 354 translate = GetExistingTranslateInfoBarDelegate(); | 359 translate = GetExistingTranslateInfoBarDelegate(); |
| 355 EXPECT_FALSE(translate); | 360 EXPECT_FALSE(translate); |
| 356 } | 361 } |
| OLD | NEW |