| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 cws_request_json_data_->GetList("redirect_chain", &redirect_list); | 427 cws_request_json_data_->GetList("redirect_chain", &redirect_list); |
| 428 ASSERT_NE(nullptr, redirect_list); | 428 ASSERT_NE(nullptr, redirect_list); |
| 429 | 429 |
| 430 // Check that the expected domains are in the redirect list. | 430 // Check that the expected domains are in the redirect list. |
| 431 const std::vector<std::string> expected_redirect_domains = { | 431 const std::vector<std::string> expected_redirect_domains = { |
| 432 kRedirect1Domain, kRedirect2Domain, kAppDomain}; | 432 kRedirect1Domain, kRedirect2Domain, kAppDomain}; |
| 433 ASSERT_EQ(expected_redirect_domains.size(), redirect_list->GetSize()); | 433 ASSERT_EQ(expected_redirect_domains.size(), redirect_list->GetSize()); |
| 434 int i = 0; | 434 int i = 0; |
| 435 for (const auto& value : *redirect_list) { | 435 for (const auto& value : *redirect_list) { |
| 436 std::string value_string; | 436 std::string value_string; |
| 437 ASSERT_TRUE(value.GetAsString(&value_string)); | 437 ASSERT_TRUE(value->GetAsString(&value_string)); |
| 438 GURL redirect_url(value_string); | 438 GURL redirect_url(value_string); |
| 439 EXPECT_EQ(expected_redirect_domains[i++], redirect_url.host()); | 439 EXPECT_EQ(expected_redirect_domains[i++], redirect_url.host()); |
| 440 } | 440 } |
| 441 } | 441 } |
| 442 | 442 |
| 443 class WebstoreInlineInstallerListenerTest : public WebstoreInlineInstallerTest { | 443 class WebstoreInlineInstallerListenerTest : public WebstoreInlineInstallerTest { |
| 444 public: | 444 public: |
| 445 WebstoreInlineInstallerListenerTest() {} | 445 WebstoreInlineInstallerListenerTest() {} |
| 446 ~WebstoreInlineInstallerListenerTest() override {} | 446 ~WebstoreInlineInstallerListenerTest() override {} |
| 447 | 447 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 WindowOpenDisposition::NEW_FOREGROUND_TAB, | 483 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 484 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 484 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 485 DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index()); | 485 DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index()); |
| 486 browser()->tab_strip_model()->CloseWebContentsAt(old_tab_index, | 486 browser()->tab_strip_model()->CloseWebContentsAt(old_tab_index, |
| 487 TabStripModel::CLOSE_NONE); | 487 TabStripModel::CLOSE_NONE); |
| 488 WebstoreInstallerTest::RunTest("runTest"); | 488 WebstoreInstallerTest::RunTest("runTest"); |
| 489 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId)); | 489 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId)); |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace extensions | 492 } // namespace extensions |
| OLD | NEW |