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

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler_unittest.cc

Issue 1092963004: [chrome/browser/extensions] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/extension_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 content::BrowserThread::PostTask( 91 content::BrowserThread::PostTask(
92 content::BrowserThread::IO, 92 content::BrowserThread::IO,
93 FROM_HERE, 93 FROM_HERE,
94 base::Bind(&Waiter::OnIOLoopPump, base::Unretained(this))); 94 base::Bind(&Waiter::OnIOLoopPump, base::Unretained(this)));
95 95
96 WaitUntilCompleted(); 96 WaitUntilCompleted();
97 } 97 }
98 98
99 private: 99 private:
100 void PumpIOLoopCompleted() { 100 void PumpIOLoopCompleted() {
101 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 101 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
102 102
103 SignalCompleted(); 103 SignalCompleted();
104 } 104 }
105 105
106 void OnIOLoopPump() { 106 void OnIOLoopPump() {
107 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 107 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
108 108
109 content::BrowserThread::PostTask( 109 content::BrowserThread::PostTask(
110 content::BrowserThread::IO, 110 content::BrowserThread::IO,
111 FROM_HERE, 111 FROM_HERE,
112 base::Bind(&Waiter::OnIOLoopPumpCompleted, base::Unretained(this))); 112 base::Bind(&Waiter::OnIOLoopPumpCompleted, base::Unretained(this)));
113 } 113 }
114 114
115 void OnIOLoopPumpCompleted() { 115 void OnIOLoopPumpCompleted() {
116 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 116 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
117 117
118 content::BrowserThread::PostTask( 118 content::BrowserThread::PostTask(
119 content::BrowserThread::UI, 119 content::BrowserThread::UI,
120 FROM_HERE, 120 FROM_HERE,
121 base::Bind(&Waiter::PumpIOLoopCompleted, base::Unretained(this))); 121 base::Bind(&Waiter::PumpIOLoopCompleted, base::Unretained(this)));
122 } 122 }
123 123
124 scoped_ptr<base::RunLoop> run_loop_; 124 scoped_ptr<base::RunLoop> run_loop_;
125 125
126 DISALLOW_COPY_AND_ASSIGN(Waiter); 126 DISALLOW_COPY_AND_ASSIGN(Waiter);
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 // App handler is removed when the extension is updated to the version that 451 // App handler is removed when the extension is updated to the version that
452 // has GCM permission removed. 452 // has GCM permission removed.
453 UpdateExtension(extension.get(), "good2.crx"); 453 UpdateExtension(extension.get(), "good2.crx");
454 waiter()->PumpUILoop(); 454 waiter()->PumpUILoop();
455 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); 455 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero());
456 EXPECT_FALSE(HasAppHandlers(extension->id())); 456 EXPECT_FALSE(HasAppHandlers(extension->id()));
457 } 457 }
458 458
459 } // namespace extensions 459 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_garbage_collector.cc ('k') | chrome/browser/extensions/extension_storage_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698