Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: chrome/browser/chrome_content_browser_client_unittest.cc

Issue 880873003: Add unit tests target to GN build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14 matching lines...) Expand all
25 25
26 typedef testing::Test ChromeContentBrowserClientTest; 26 typedef testing::Test ChromeContentBrowserClientTest;
27 27
28 TEST_F(ChromeContentBrowserClientTest, ShouldAssignSiteForURL) { 28 TEST_F(ChromeContentBrowserClientTest, ShouldAssignSiteForURL) {
29 ChromeContentBrowserClient client; 29 ChromeContentBrowserClient client;
30 EXPECT_FALSE(client.ShouldAssignSiteForURL(GURL("chrome-native://test"))); 30 EXPECT_FALSE(client.ShouldAssignSiteForURL(GURL("chrome-native://test")));
31 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("http://www.google.com"))); 31 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("http://www.google.com")));
32 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("https://www.google.com"))); 32 EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("https://www.google.com")));
33 } 33 }
34 34
35 #if defined(ENABLE_WEBRTC)
36
35 // NOTE: Any updates to the expectations in these tests should also be done in 37 // NOTE: Any updates to the expectations in these tests should also be done in
36 // the browser test WebRtcDisableEncryptionFlagBrowserTest. 38 // the browser test WebRtcDisableEncryptionFlagBrowserTest.
37 class DisableWebRtcEncryptionFlagTest : public testing::Test { 39 class DisableWebRtcEncryptionFlagTest : public testing::Test {
38 public: 40 public:
39 DisableWebRtcEncryptionFlagTest() 41 DisableWebRtcEncryptionFlagTest()
40 : from_command_line_(base::CommandLine::NO_PROGRAM), 42 : from_command_line_(base::CommandLine::NO_PROGRAM),
41 to_command_line_(base::CommandLine::NO_PROGRAM) {} 43 to_command_line_(base::CommandLine::NO_PROGRAM) {}
42 44
43 protected: 45 protected:
44 void SetUp() override { 46 void SetUp() override {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 #else 82 #else
81 EXPECT_FALSE(to_command_line_.HasSwitch(switches::kDisableWebRtcEncryption)); 83 EXPECT_FALSE(to_command_line_.HasSwitch(switches::kDisableWebRtcEncryption));
82 #endif 84 #endif
83 } 85 }
84 86
85 TEST_F(DisableWebRtcEncryptionFlagTest, StableChannel) { 87 TEST_F(DisableWebRtcEncryptionFlagTest, StableChannel) {
86 MaybeCopyDisableWebRtcEncryptionSwitch(VersionInfo::CHANNEL_STABLE); 88 MaybeCopyDisableWebRtcEncryptionSwitch(VersionInfo::CHANNEL_STABLE);
87 EXPECT_FALSE(to_command_line_.HasSwitch(switches::kDisableWebRtcEncryption)); 89 EXPECT_FALSE(to_command_line_.HasSwitch(switches::kDisableWebRtcEncryption));
88 } 90 }
89 91
92 #endif // ENABLE_WEBRTC
93
90 } // namespace chrome 94 } // namespace chrome
91 95
92 #if !defined(OS_IOS) && !defined(OS_ANDROID) 96 #if !defined(OS_IOS) && !defined(OS_ANDROID)
93 namespace content { 97 namespace content {
94 98
95 class InstantNTPURLRewriteTest : public BrowserWithTestWindowTest { 99 class InstantNTPURLRewriteTest : public BrowserWithTestWindowTest {
96 protected: 100 protected:
97 void SetUp() override { 101 void SetUp() override {
98 BrowserWithTestWindowTest::SetUp(); 102 BrowserWithTestWindowTest::SetUp();
99 field_trial_list_.reset(new base::FieldTrialList( 103 field_trial_list_.reset(new base::FieldTrialList(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 199
196 #if defined(OS_ANDROID) 200 #if defined(OS_ANDROID)
197 SetPermission(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, 201 SetPermission(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER,
198 CONTENT_SETTING_ALLOW); 202 CONTENT_SETTING_ALLOW);
199 CheckPermissionStatus(PERMISSION_PROTECTED_MEDIA_IDENTIFIER, 203 CheckPermissionStatus(PERMISSION_PROTECTED_MEDIA_IDENTIFIER,
200 PERMISSION_STATUS_GRANTED); 204 PERMISSION_STATUS_GRANTED);
201 #endif 205 #endif
202 } 206 }
203 207
204 } // namespace chrome 208 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/ui/views/extensions/browser_action_drag_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698