| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 db_thread_.Start(); | 96 db_thread_.Start(); |
| 97 wds_ = new WebDataService(); | 97 wds_ = new WebDataService(); |
| 98 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 98 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 99 wds_->Init(temp_dir_.path()); | 99 wds_->Init(temp_dir_.path()); |
| 100 registry_.Initialize(wds_, &extension_service_); | 100 registry_.Initialize(wds_, &extension_service_); |
| 101 EXPECT_CALL(extension_service_, extensions()). | 101 EXPECT_CALL(extension_service_, extensions()). |
| 102 WillRepeatedly(testing::Return(&extensions_)); | 102 WillRepeatedly(testing::Return(&extensions_)); |
| 103 EXPECT_CALL(extension_service_, GetExtensionById(testing::_, testing::_)). | 103 EXPECT_CALL(extension_service_, GetExtensionById(testing::_, testing::_)). |
| 104 WillRepeatedly( | 104 WillRepeatedly( |
| 105 testing::Invoke(this, &WebIntentsRegistryTest::GetExtensionById)); | 105 testing::Invoke(this, &WebIntentsRegistryTest::GetExtensionById)); |
| 106 extensions::ManifestHandler::Register(extension_manifest_keys::kIntents, | 106 extensions::ManifestHandler::Register( |
| 107 new extensions::WebIntentsHandler); | 107 extension_manifest_keys::kIntents, |
| 108 make_linked_ptr(new extensions::WebIntentsHandler)); |
| 108 } | 109 } |
| 109 | 110 |
| 110 virtual void TearDown() { | 111 virtual void TearDown() { |
| 111 // Clear all references to wds to force it destruction. | 112 // Clear all references to wds to force it destruction. |
| 112 wds_->ShutdownOnUIThread(); | 113 wds_->ShutdownOnUIThread(); |
| 113 wds_ = NULL; | 114 wds_ = NULL; |
| 114 | 115 |
| 115 // Schedule another task on the DB thread to notify us that it's safe to | 116 // Schedule another task on the DB thread to notify us that it's safe to |
| 116 // carry on with the test. | 117 // carry on with the test. |
| 117 base::WaitableEvent done(false, false); | 118 base::WaitableEvent done(false, false); |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 798 |
| 798 registry_.GetAllDefaultIntentServices( | 799 registry_.GetAllDefaultIntentServices( |
| 799 base::Bind(&DefaultServiceListConsumer::Accept, | 800 base::Bind(&DefaultServiceListConsumer::Accept, |
| 800 base::Unretained(&consumer))); | 801 base::Unretained(&consumer))); |
| 801 | 802 |
| 802 consumer.WaitForData(); | 803 consumer.WaitForData(); |
| 803 | 804 |
| 804 ASSERT_EQ(1U, consumer.services_.size()); | 805 ASSERT_EQ(1U, consumer.services_.size()); |
| 805 EXPECT_EQ(service_url_1.spec(), consumer.services_[0].service_url); | 806 EXPECT_EQ(service_url_1.spec(), consumer.services_[0].service_url); |
| 806 } | 807 } |
| OLD | NEW |