| 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "chrome/browser/search_engines/template_url_service_factory.h" | 9 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 EXPECT_FALSE(client.ShouldAssignSiteForURL(GURL("chrome-native://test"))); | 29 EXPECT_FALSE(client.ShouldAssignSiteForURL(GURL("chrome-native://test"))); |
| 30 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("http://www.google.com"))); | 30 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("http://www.google.com"))); |
| 31 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("https://www.google.com"))); | 31 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("https://www.google.com"))); |
| 32 } | 32 } |
| 33 | 33 |
| 34 // NOTE: Any updates to the expectations in these tests should also be done in | 34 // NOTE: Any updates to the expectations in these tests should also be done in |
| 35 // the browser test WebRtcDisableEncryptionFlagBrowserTest. | 35 // the browser test WebRtcDisableEncryptionFlagBrowserTest. |
| 36 class DisableWebRtcEncryptionFlagTest : public testing::Test { | 36 class DisableWebRtcEncryptionFlagTest : public testing::Test { |
| 37 public: | 37 public: |
| 38 DisableWebRtcEncryptionFlagTest() | 38 DisableWebRtcEncryptionFlagTest() |
| 39 : from_command_line_(CommandLine::NO_PROGRAM), | 39 : from_command_line_(base::CommandLine::NO_PROGRAM), |
| 40 to_command_line_(CommandLine::NO_PROGRAM) {} | 40 to_command_line_(base::CommandLine::NO_PROGRAM) {} |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 void SetUp() override { | 43 void SetUp() override { |
| 44 from_command_line_.AppendSwitch(switches::kDisableWebRtcEncryption); | 44 from_command_line_.AppendSwitch(switches::kDisableWebRtcEncryption); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void MaybeCopyDisableWebRtcEncryptionSwitch(VersionInfo::Channel channel) { | 47 void MaybeCopyDisableWebRtcEncryptionSwitch(VersionInfo::Channel channel) { |
| 48 ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch( | 48 ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch( |
| 49 &to_command_line_, | 49 &to_command_line_, |
| 50 from_command_line_, | 50 from_command_line_, |
| 51 channel); | 51 channel); |
| 52 } | 52 } |
| 53 | 53 |
| 54 CommandLine from_command_line_; | 54 base::CommandLine from_command_line_; |
| 55 CommandLine to_command_line_; | 55 base::CommandLine to_command_line_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(DisableWebRtcEncryptionFlagTest); | 57 DISALLOW_COPY_AND_ASSIGN(DisableWebRtcEncryptionFlagTest); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 TEST_F(DisableWebRtcEncryptionFlagTest, UnknownChannel) { | 60 TEST_F(DisableWebRtcEncryptionFlagTest, UnknownChannel) { |
| 61 MaybeCopyDisableWebRtcEncryptionSwitch(VersionInfo::CHANNEL_UNKNOWN); | 61 MaybeCopyDisableWebRtcEncryptionSwitch(VersionInfo::CHANNEL_UNKNOWN); |
| 62 EXPECT_TRUE(to_command_line_.HasSwitch(switches::kDisableWebRtcEncryption)); | 62 EXPECT_TRUE(to_command_line_.HasSwitch(switches::kDisableWebRtcEncryption)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 TEST_F(DisableWebRtcEncryptionFlagTest, CanaryChannel) { | 65 TEST_F(DisableWebRtcEncryptionFlagTest, CanaryChannel) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 NavigationEntry* entry = browser()->tab_strip_model()-> | 131 NavigationEntry* entry = browser()->tab_strip_model()-> |
| 132 GetActiveWebContents()->GetController().GetLastCommittedEntry(); | 132 GetActiveWebContents()->GetController().GetLastCommittedEntry(); |
| 133 ASSERT_TRUE(entry != NULL); | 133 ASSERT_TRUE(entry != NULL); |
| 134 EXPECT_EQ(url_rewritten, entry->GetURL()); | 134 EXPECT_EQ(url_rewritten, entry->GetURL()); |
| 135 EXPECT_EQ(url_original, entry->GetVirtualURL()); | 135 EXPECT_EQ(url_original, entry->GetVirtualURL()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace content | 138 } // namespace content |
| 139 #endif // !defined(OS_IOS) && !defined(OS_ANDROID) | 139 #endif // !defined(OS_IOS) && !defined(OS_ANDROID) |
| OLD | NEW |