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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2903573005: Set up Finch feature for network time policy browser test (Closed)
Patch Set: fix command line switches Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 14 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
15 #include "base/base_switches.h"
15 #include "base/bind.h" 16 #include "base/bind.h"
16 #include "base/bind_helpers.h" 17 #include "base/bind_helpers.h"
17 #include "base/callback.h" 18 #include "base/callback.h"
18 #include "base/callback_helpers.h" 19 #include "base/callback_helpers.h"
19 #include "base/command_line.h" 20 #include "base/command_line.h"
20 #include "base/files/file_enumerator.h" 21 #include "base/files/file_enumerator.h"
21 #include "base/files/file_path.h" 22 #include "base/files/file_path.h"
22 #include "base/files/file_util.h" 23 #include "base/files/file_util.h"
23 #include "base/files/scoped_temp_dir.h" 24 #include "base/files/scoped_temp_dir.h"
24 #include "base/macros.h" 25 #include "base/macros.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 #include "components/security_interstitials/content/security_interstitial_page.h " 126 #include "components/security_interstitials/content/security_interstitial_page.h "
126 #include "components/security_interstitials/core/controller_client.h" 127 #include "components/security_interstitials/core/controller_client.h"
127 #include "components/strings/grit/components_strings.h" 128 #include "components/strings/grit/components_strings.h"
128 #include "components/translate/core/browser/language_state.h" 129 #include "components/translate/core/browser/language_state.h"
129 #include "components/translate/core/browser/translate_infobar_delegate.h" 130 #include "components/translate/core/browser/translate_infobar_delegate.h"
130 #include "components/update_client/update_client.h" 131 #include "components/update_client/update_client.h"
131 #include "components/update_client/update_client_errors.h" 132 #include "components/update_client/update_client_errors.h"
132 #include "components/update_client/url_request_post_interceptor.h" 133 #include "components/update_client/url_request_post_interceptor.h"
133 #include "components/user_prefs/user_prefs.h" 134 #include "components/user_prefs/user_prefs.h"
134 #include "components/variations/service/variations_service.h" 135 #include "components/variations/service/variations_service.h"
136 #include "components/variations/variations_switches.h"
135 #include "components/version_info/version_info.h" 137 #include "components/version_info/version_info.h"
136 #include "content/public/browser/browser_context.h" 138 #include "content/public/browser/browser_context.h"
137 #include "content/public/browser/browser_thread.h" 139 #include "content/public/browser/browser_thread.h"
138 #include "content/public/browser/child_process_data.h" 140 #include "content/public/browser/child_process_data.h"
139 #include "content/public/browser/download_item.h" 141 #include "content/public/browser/download_item.h"
140 #include "content/public/browser/download_manager.h" 142 #include "content/public/browser/download_manager.h"
141 #include "content/public/browser/gpu_data_manager.h" 143 #include "content/public/browser/gpu_data_manager.h"
142 #include "content/public/browser/interstitial_page.h" 144 #include "content/public/browser/interstitial_page.h"
143 #include "content/public/browser/notification_details.h" 145 #include "content/public/browser/notification_details.h"
144 #include "content/public/browser/notification_observer.h" 146 #include "content/public/browser/notification_observer.h"
(...skipping 4354 matching lines...) Expand 10 before | Expand all | Expand 10 after
4499 SetEmptyPolicy(); 4501 SetEmptyPolicy();
4500 // Policy not set. 4502 // Policy not set.
4501 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4503 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4502 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4504 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4503 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4505 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4504 } 4506 }
4505 #endif // defined(OS_CHROMEOS) 4507 #endif // defined(OS_CHROMEOS)
4506 4508
4507 class NetworkTimePolicyTest : public PolicyTest { 4509 class NetworkTimePolicyTest : public PolicyTest {
4508 public: 4510 public:
4511 void SetUpCommandLine(base::CommandLine* command_line) override {
4512 command_line->AppendSwitchASCII(
4513 switches::kEnableFeatures,
4514 std::string(network_time::kNetworkTimeServiceQuerying.name) +
4515 "<SSLNetworkTimeBrowserTestFieldTrial");
Nico 2017/05/24 17:43:03 The < here is intentional, yes?
estark 2017/05/24 17:45:17 Yeah, it's the --enable-features syntax (it's "Gro
4516 command_line->AppendSwitchASCII(
4517 switches::kForceFieldTrials,
4518 "SSLNetworkTimeBrowserTestFieldTrial/Enabled/");
4519 command_line->AppendSwitchASCII(
4520 variations::switches::kForceFieldTrialParams,
4521 "SSLNetworkTimeBrowserTestFieldTrial.Enabled:FetchBehavior/"
4522 "on-demand-only");
4523 }
4524
4509 // A request handler that returns a dummy response and counts the number of 4525 // A request handler that returns a dummy response and counts the number of
4510 // times it is called. 4526 // times it is called.
4511 std::unique_ptr<net::test_server::HttpResponse> CountingRequestHandler( 4527 std::unique_ptr<net::test_server::HttpResponse> CountingRequestHandler(
4512 const net::test_server::HttpRequest& request) { 4528 const net::test_server::HttpRequest& request) {
4513 net::test_server::BasicHttpResponse* response = 4529 net::test_server::BasicHttpResponse* response =
4514 new net::test_server::BasicHttpResponse(); 4530 new net::test_server::BasicHttpResponse();
4515 num_requests_++; 4531 num_requests_++;
4516 response->set_code(net::HTTP_OK); 4532 response->set_code(net::HTTP_OK);
4517 response->set_content( 4533 response->set_content(
4518 ")]}'\n" 4534 ")]}'\n"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
4561 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, 4577 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
4562 base::MakeUnique<base::Value>(true), nullptr); 4578 base::MakeUnique<base::Value>(true), nullptr);
4563 UpdateProviderPolicy(policies); 4579 UpdateProviderPolicy(policies);
4564 ui_test_utils::NavigateToURL(browser(), https_server_expired_.GetURL("/")); 4580 ui_test_utils::NavigateToURL(browser(), https_server_expired_.GetURL("/"));
4565 interstitial_page = tab->GetInterstitialPage(); 4581 interstitial_page = tab->GetInterstitialPage();
4566 ASSERT_TRUE(interstitial_page); 4582 ASSERT_TRUE(interstitial_page);
4567 EXPECT_EQ(1u, num_requests()); 4583 EXPECT_EQ(1u, num_requests());
4568 } 4584 }
4569 4585
4570 } // namespace policy 4586 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698