| 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/json/json_file_value_serializer.h" | 6 #include "base/json/json_file_value_serializer.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 wds_->Init(temp_dir_.path()); | 94 wds_->Init(temp_dir_.path()); |
| 95 registry_.Initialize(wds_, &extension_service_); | 95 registry_.Initialize(wds_, &extension_service_); |
| 96 EXPECT_CALL(extension_service_, extensions()). | 96 EXPECT_CALL(extension_service_, extensions()). |
| 97 WillRepeatedly(testing::Return(&extensions_)); | 97 WillRepeatedly(testing::Return(&extensions_)); |
| 98 EXPECT_CALL(extension_service_, GetExtensionById(testing::_, testing::_)). | 98 EXPECT_CALL(extension_service_, GetExtensionById(testing::_, testing::_)). |
| 99 WillRepeatedly( | 99 WillRepeatedly( |
| 100 testing::Invoke(this, &WebIntentsRegistryTest::GetExtensionById)); | 100 testing::Invoke(this, &WebIntentsRegistryTest::GetExtensionById)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 virtual void TearDown() { | 103 virtual void TearDown() { |
| 104 if (wds_.get()) | 104 wds_ = NULL; |
| 105 wds_->Shutdown(); | |
| 106 | 105 |
| 107 db_thread_.Stop(); | 106 db_thread_.Stop(); |
| 108 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 107 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 109 MessageLoop::current()->Run(); | 108 MessageLoop::current()->Run(); |
| 110 } | 109 } |
| 111 | 110 |
| 112 const Extension* GetExtensionById(const std::string& extension_id, | 111 const Extension* GetExtensionById(const std::string& extension_id, |
| 113 testing::Unused) { | 112 testing::Unused) { |
| 114 for (ExtensionSet::const_iterator iter = extensions_.begin(); | 113 for (ExtensionSet::const_iterator iter = extensions_.begin(); |
| 115 iter != extensions_.end(); ++iter) { | 114 iter != extensions_.end(); ++iter) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 consumer.expected_id_ = registry_.GetDefaultIntentService( | 422 consumer.expected_id_ = registry_.GetDefaultIntentService( |
| 424 ASCIIToUTF16("share"), | 423 ASCIIToUTF16("share"), |
| 425 ASCIIToUTF16("notype/plain"), | 424 ASCIIToUTF16("notype/plain"), |
| 426 GURL("http://www.google.com/"), | 425 GURL("http://www.google.com/"), |
| 427 &consumer); | 426 &consumer); |
| 428 | 427 |
| 429 consumer.WaitForData(); | 428 consumer.WaitForData(); |
| 430 | 429 |
| 431 EXPECT_EQ("", consumer.default_.service_url); | 430 EXPECT_EQ("", consumer.default_.service_url); |
| 432 } | 431 } |
| OLD | NEW |