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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/string_piece.h" | 7 #include "base/strings/string_piece.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/history/history_types.h" | 12 #include "chrome/browser/history/history_types.h" |
13 #include "chrome/browser/sync/glue/typed_url_model_associator.h" | 13 #include "chrome/browser/sync/glue/typed_url_model_associator.h" |
14 #include "chrome/browser/sync/profile_sync_service_mock.h" | 14 #include "chrome/browser/sync/profile_sync_service_mock.h" |
15 #include "content/public/test/test_browser_thread.h" | 15 #include "content/public/test/test_browser_thread.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "sync/protocol/typed_url_specifics.pb.h" | 17 #include "sync/protocol/typed_url_specifics.pb.h" |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, callback); | 437 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, callback); |
438 // Wait for the model associator to get created and start assocation. | 438 // Wait for the model associator to get created and start assocation. |
439 ASSERT_TRUE(startup.TimedWait(TestTimeouts::action_timeout())); | 439 ASSERT_TRUE(startup.TimedWait(TestTimeouts::action_timeout())); |
440 // Abort the model assocation - this should be callable from any thread. | 440 // Abort the model assocation - this should be callable from any thread. |
441 associator->AbortAssociation(); | 441 associator->AbortAssociation(); |
442 // Tell the remote thread to continue. | 442 // Tell the remote thread to continue. |
443 aborted.Signal(); | 443 aborted.Signal(); |
444 // Block until CreateModelAssociator() exits. | 444 // Block until CreateModelAssociator() exits. |
445 ASSERT_TRUE(done.TimedWait(TestTimeouts::action_timeout())); | 445 ASSERT_TRUE(done.TimedWait(TestTimeouts::action_timeout())); |
446 } | 446 } |
OLD | NEW |