| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 82 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 83 wds_ = new WebDataService(); | 83 wds_ = new WebDataService(); |
| 84 wds_->Init(temp_dir_.path()); | 84 wds_->Init(temp_dir_.path()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 virtual void TearDown() { | 87 virtual void TearDown() { |
| 88 if (wds_.get()) | 88 if (wds_.get()) |
| 89 wds_->Shutdown(); | 89 wds_->Shutdown(); |
| 90 | 90 |
| 91 db_thread_.Stop(); | 91 db_thread_.Stop(); |
| 92 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 92 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 93 MessageLoop::current()->Run(); | 93 MessageLoop::current()->Run(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 MessageLoopForUI message_loop_; | 96 MessageLoopForUI message_loop_; |
| 97 content::TestBrowserThread ui_thread_; | 97 content::TestBrowserThread ui_thread_; |
| 98 content::TestBrowserThread db_thread_; | 98 content::TestBrowserThread db_thread_; |
| 99 FilePath profile_dir_; | 99 FilePath profile_dir_; |
| 100 scoped_refptr<WebDataService> wds_; | 100 scoped_refptr<WebDataService> wds_; |
| 101 ScopedTempDir temp_dir_; | 101 ScopedTempDir temp_dir_; |
| 102 }; | 102 }; |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 } | 726 } |
| 727 | 727 |
| 728 TEST_F(WebDataServiceTest, DidDefaultSearchProviderChangeOnNewProfile) { | 728 TEST_F(WebDataServiceTest, DidDefaultSearchProviderChangeOnNewProfile) { |
| 729 KeywordsConsumer consumer; | 729 KeywordsConsumer consumer; |
| 730 wds_->GetKeywords(&consumer); | 730 wds_->GetKeywords(&consumer); |
| 731 KeywordsConsumer::WaitUntilCalled(); | 731 KeywordsConsumer::WaitUntilCalled(); |
| 732 ASSERT_TRUE(consumer.load_succeeded); | 732 ASSERT_TRUE(consumer.load_succeeded); |
| 733 EXPECT_FALSE(consumer.keywords_result.did_default_search_provider_change); | 733 EXPECT_FALSE(consumer.keywords_result.did_default_search_provider_change); |
| 734 EXPECT_EQ(0, consumer.keywords_result.default_search_provider_id_backup); | 734 EXPECT_EQ(0, consumer.keywords_result.default_search_provider_id_backup); |
| 735 } | 735 } |
| OLD | NEW |