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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/json/json_value_serializer.h" | 6 #include "base/json/json_value_serializer.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/intents/web_intents_registry.h" | 10 #include "chrome/browser/intents/web_intents_registry.h" |
11 #include "chrome/browser/webdata/web_data_service.h" | 11 #include "chrome/browser/webdata/web_data_service.h" |
12 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
13 #include "content/test/test_browser_thread.h" | 13 #include "content/test/test_browser_thread.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
| 17 using content::BrowserThread; |
| 18 |
17 class MockExtensionService: public ExtensionServiceInterface { | 19 class MockExtensionService: public ExtensionServiceInterface { |
18 public: | 20 public: |
19 virtual ~MockExtensionService() {} | 21 virtual ~MockExtensionService() {} |
20 MOCK_CONST_METHOD0(extensions, const ExtensionList*()); | 22 MOCK_CONST_METHOD0(extensions, const ExtensionList*()); |
21 MOCK_METHOD0(pending_extension_manager, PendingExtensionManager*()); | 23 MOCK_METHOD0(pending_extension_manager, PendingExtensionManager*()); |
22 MOCK_METHOD4(UpdateExtension, bool(const std::string& id, | 24 MOCK_METHOD4(UpdateExtension, bool(const std::string& id, |
23 const FilePath& path, | 25 const FilePath& path, |
24 const GURL& download_url, | 26 const GURL& download_url, |
25 CrxInstaller** out_crx_installer)); | 27 CrxInstaller** out_crx_installer)); |
26 MOCK_CONST_METHOD2(GetExtensionById, | 28 MOCK_CONST_METHOD2(GetExtensionById, |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 consumer.expected_id_ = registry_.GetIntentProviders( | 344 consumer.expected_id_ = registry_.GetIntentProviders( |
343 ASCIIToUTF16("http://webintents.org/share"), | 345 ASCIIToUTF16("http://webintents.org/share"), |
344 ASCIIToUTF16("*"), &consumer); | 346 ASCIIToUTF16("*"), &consumer); |
345 consumer.WaitForData(); | 347 consumer.WaitForData(); |
346 ASSERT_EQ(4U, consumer.services_.size()); | 348 ASSERT_EQ(4U, consumer.services_.size()); |
347 EXPECT_EQ(services[0], consumer.services_[0]); | 349 EXPECT_EQ(services[0], consumer.services_[0]); |
348 EXPECT_EQ(services[1], consumer.services_[1]); | 350 EXPECT_EQ(services[1], consumer.services_[1]); |
349 EXPECT_EQ(services[2], consumer.services_[2]); | 351 EXPECT_EQ(services[2], consumer.services_[2]); |
350 EXPECT_EQ(services[3], consumer.services_[3]); | 352 EXPECT_EQ(services[3], consumer.services_[3]); |
351 } | 353 } |
OLD | NEW |