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

Side by Side Diff: chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc

Issue 2352853002: Disallow redundant Bind calls. (Closed)
Patch Set: static_assert message tweak Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <utility> 5 #include <utility>
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return last_on_started_finalizing_success_; 95 return last_on_started_finalizing_success_;
96 } 96 }
97 97
98 private: 98 private:
99 void OnUpload(const scoped_refptr<base::RefCountedString>& file_contents, 99 void OnUpload(const scoped_refptr<base::RefCountedString>& file_contents,
100 std::unique_ptr<const base::DictionaryValue> metadata, 100 std::unique_ptr<const base::DictionaryValue> metadata,
101 base::Callback<void()> done_callback) { 101 base::Callback<void()> done_callback) {
102 receive_count_ += 1; 102 receive_count_ += 1;
103 103
104 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 104 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
105 base::Bind(done_callback)); 105 done_callback);
106 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 106 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
107 base::Bind(on_upload_callback_)); 107 on_upload_callback_);
108 } 108 }
109 109
110 void OnStartedFinalizing(bool success) { 110 void OnStartedFinalizing(bool success) {
111 started_finalizations_count_++; 111 started_finalizations_count_++;
112 last_on_started_finalizing_success_ = success; 112 last_on_started_finalizing_success_ = success;
113 113
114 if (!on_started_finalization_callback_.is_null()) { 114 if (!on_started_finalization_callback_.is_null()) {
115 content::BrowserThread::PostTask( 115 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
116 content::BrowserThread::UI, FROM_HERE, 116 on_started_finalization_callback_);
117 base::Bind(on_started_finalization_callback_));
118 } 117 }
119 } 118 }
120 119
121 base::Closure on_upload_callback_; 120 base::Closure on_upload_callback_;
122 base::Closure on_started_finalization_callback_; 121 base::Closure on_started_finalization_callback_;
123 int receive_count_; 122 int receive_count_;
124 int started_finalizations_count_; 123 int started_finalizations_count_;
125 content::BackgroundTracingManager::TriggerHandle trigger_handle_; 124 content::BackgroundTracingManager::TriggerHandle trigger_handle_;
126 bool last_on_started_finalizing_success_; 125 bool last_on_started_finalizing_success_;
127 }; 126 };
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 276
278 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup, 277 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup,
279 StartupTracingThrottle) { 278 StartupTracingThrottle) {
280 // The startup scenario should *not* be started, since not enough 279 // The startup scenario should *not* be started, since not enough
281 // time has elapsed since the last upload (set in the PRE_ above). 280 // time has elapsed since the last upload (set in the PRE_ above).
282 EXPECT_FALSE( 281 EXPECT_FALSE(
283 content::BackgroundTracingManager::GetInstance()->HasActiveScenario()); 282 content::BackgroundTracingManager::GetInstance()->HasActiveScenario());
284 } 283 }
285 284
286 } // namespace 285 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service_unittest.cc ('k') | chromecast/base/bind_to_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698