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

Side by Side Diff: chrome/browser/ui/webui/settings/metrics_reporting_handler_unittest.cc

Issue 2265553003: MD Settings: fix metrics reporting unittests on official testers -- take 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) 5 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS)
6 6
7 #include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h" 7 #include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h"
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 args.Append(base::WrapUnique(new base::FundamentalValue(1))); 54 args.Append(base::WrapUnique(new base::FundamentalValue(1)));
55 handler()->HandleGetMetricsReporting(&args); 55 handler()->HandleGetMetricsReporting(&args);
56 56
57 EXPECT_TRUE(handler()->IsJavascriptAllowed()); 57 EXPECT_TRUE(handler()->IsJavascriptAllowed());
58 EXPECT_EQ(1u, test_web_ui()->call_data().size()); 58 EXPECT_EQ(1u, test_web_ui()->call_data().size());
59 59
60 test_web_ui()->ClearTrackedCalls(); 60 test_web_ui()->ClearTrackedCalls();
61 } 61 }
62 62
63 void TearDown() override { 63 void TearDown() override {
64 // For crbug.com/637068 which only run on official bots with no try jobs.
dschuyler 2016/08/24 22:14:59 I suggest ignoring this optional nit: but just to
65 base::RunLoop().RunUntilIdle();
64 handler_.reset(); 66 handler_.reset();
67 base::RunLoop().RunUntilIdle();
68 local_state_.reset();
69 base::RunLoop().RunUntilIdle();
65 } 70 }
66 71
67 PrefService* local_state() { return local_state_->Get(); } 72 PrefService* local_state() { return local_state_->Get(); }
68 TestingMetricsReportingHandler* handler() { return handler_.get(); } 73 TestingMetricsReportingHandler* handler() { return handler_.get(); }
69 content::TestWebUI* test_web_ui() { return &test_web_ui_; } 74 content::TestWebUI* test_web_ui() { return &test_web_ui_; }
70 policy::PolicyMap* map() { return &map_; } 75 policy::PolicyMap* map() { return &map_; }
71 policy::MockConfigurationPolicyProvider* provider() { return &provider_; } 76 policy::MockConfigurationPolicyProvider* provider() { return &provider_; }
72 77
73 private: 78 private:
74 content::TestBrowserThreadBundle thread_bundle_; 79 content::TestBrowserThreadBundle thread_bundle_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 policy::POLICY_SOURCE_CLOUD, 123 policy::POLICY_SOURCE_CLOUD,
119 base::WrapUnique(new base::FundamentalValue(false)), 124 base::WrapUnique(new base::FundamentalValue(false)),
120 nullptr); 125 nullptr);
121 provider()->UpdateChromePolicy(*map()); 126 provider()->UpdateChromePolicy(*map());
122 EXPECT_TRUE(test_web_ui()->call_data().empty()); 127 EXPECT_TRUE(test_web_ui()->call_data().empty());
123 } 128 }
124 129
125 } // namespace settings 130 } // namespace settings
126 131
127 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) 132 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS)
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