Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "chrome/browser/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 // this should handle new datatype-specific top level folders). | 353 // this should handle new datatype-specific top level folders). |
| 354 number_of_default_sync_items_ = GetClient(0)->GetNumEntries() - | 354 number_of_default_sync_items_ = GetClient(0)->GetNumEntries() - |
| 355 GetClient(0)->GetNumDatatypes() - 6; | 355 GetClient(0)->GetNumDatatypes() - 6; |
| 356 DVLOG(1) << "Setting " << number_of_default_sync_items_ << " as default " | 356 DVLOG(1) << "Setting " << number_of_default_sync_items_ << " as default " |
| 357 << " number of entries."; | 357 << " number of entries."; |
| 358 | 358 |
| 359 return true; | 359 return true; |
| 360 } | 360 } |
| 361 | 361 |
| 362 void SyncTest::CleanUpOnMainThread() { | 362 void SyncTest::CleanUpOnMainThread() { |
| 363 // Some of the pending messages might rely on browser windows still being | |
| 364 // around, so run messages both before and after closing all browsers. | |
|
akalin
2012/11/19 19:28:59
whoa, what did you run into that needed this?
Marijn Kruisselbrink
2012/11/19 19:39:59
Without that line, I got the following stack trace
| |
| 365 content::RunAllPendingInMessageLoop(); | |
| 363 // Close all browser windows. | 366 // Close all browser windows. |
| 364 browser::CloseAllBrowsers(); | 367 browser::CloseAllBrowsers(); |
| 365 content::RunAllPendingInMessageLoop(); | 368 content::RunAllPendingInMessageLoop(); |
| 366 | 369 |
| 367 // All browsers should be closed at this point, or else we could see memory | 370 // All browsers should be closed at this point, or else we could see memory |
| 368 // corruption in QuitBrowser(). | 371 // corruption in QuitBrowser(). |
| 369 CHECK_EQ(0U, BrowserList::size()); | 372 CHECK_EQ(0U, BrowserList::size()); |
| 370 clients_.clear(); | 373 clients_.clear(); |
| 371 } | 374 } |
| 372 | 375 |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 818 | 821 |
| 819 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 822 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
| 820 const net::ProxyConfig& proxy_config) { | 823 const net::ProxyConfig& proxy_config) { |
| 821 base::WaitableEvent done(false, false); | 824 base::WaitableEvent done(false, false); |
| 822 BrowserThread::PostTask( | 825 BrowserThread::PostTask( |
| 823 BrowserThread::IO, FROM_HERE, | 826 BrowserThread::IO, FROM_HERE, |
| 824 base::Bind(&SetProxyConfigCallback, &done, | 827 base::Bind(&SetProxyConfigCallback, &done, |
| 825 make_scoped_refptr(context_getter), proxy_config)); | 828 make_scoped_refptr(context_getter), proxy_config)); |
| 826 done.Wait(); | 829 done.Wait(); |
| 827 } | 830 } |
| OLD | NEW |