| 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 "chrome/browser/extensions/webstore_inline_installer.h" | 5 #include "chrome/browser/extensions/webstore_inline_installer.h" |
| 6 | 6 |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 ui_test_utils::NavigateToURL( | 371 ui_test_utils::NavigateToURL( |
| 372 browser(), GenerateTestServerUrl(kAppDomain, "double_install.html")); | 372 browser(), GenerateTestServerUrl(kAppDomain, "double_install.html")); |
| 373 RunTest("runTest"); | 373 RunTest("runTest"); |
| 374 } | 374 } |
| 375 | 375 |
| 376 class WebstoreInlineInstallerRedirectTest : public WebstoreInlineInstallerTest { | 376 class WebstoreInlineInstallerRedirectTest : public WebstoreInlineInstallerTest { |
| 377 public: | 377 public: |
| 378 WebstoreInlineInstallerRedirectTest() : cws_request_received_(false) {} | 378 WebstoreInlineInstallerRedirectTest() : cws_request_received_(false) {} |
| 379 ~WebstoreInlineInstallerRedirectTest() override {} | 379 ~WebstoreInlineInstallerRedirectTest() override {} |
| 380 | 380 |
| 381 void SetUpInProcessBrowserTestFixture() override { | 381 void SetUpOnMainThread() override { |
| 382 WebstoreInstallerTest::SetUpInProcessBrowserTestFixture(); | 382 WebstoreInstallerTest::SetUpOnMainThread(); |
| 383 host_resolver()->AddRule(kRedirect1Domain, "127.0.0.1"); | 383 host_resolver()->AddRule(kRedirect1Domain, "127.0.0.1"); |
| 384 host_resolver()->AddRule(kRedirect2Domain, "127.0.0.1"); | 384 host_resolver()->AddRule(kRedirect2Domain, "127.0.0.1"); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void ProcessServerRequest( | 387 void ProcessServerRequest( |
| 388 const net::test_server::HttpRequest& request) override { | 388 const net::test_server::HttpRequest& request) override { |
| 389 cws_request_received_ = true; | 389 cws_request_received_ = true; |
| 390 if (request.content.find("redirect_chain") != std::string::npos) { | 390 if (request.content.find("redirect_chain") != std::string::npos) { |
| 391 std::unique_ptr<base::Value> contents = | 391 std::unique_ptr<base::Value> contents = |
| 392 base::JSONReader::Read(request.content); | 392 base::JSONReader::Read(request.content); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 WindowOpenDisposition::NEW_FOREGROUND_TAB, | 516 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 517 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 517 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 518 DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index()); | 518 DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index()); |
| 519 browser()->tab_strip_model()->CloseWebContentsAt(old_tab_index, | 519 browser()->tab_strip_model()->CloseWebContentsAt(old_tab_index, |
| 520 TabStripModel::CLOSE_NONE); | 520 TabStripModel::CLOSE_NONE); |
| 521 WebstoreInstallerTest::RunTest("runTest"); | 521 WebstoreInstallerTest::RunTest("runTest"); |
| 522 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId)); | 522 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId)); |
| 523 } | 523 } |
| 524 | 524 |
| 525 } // namespace extensions | 525 } // namespace extensions |
| OLD | NEW |