| 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/scoped_temp_dir.h" | 6 #include "base/scoped_temp_dir.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/intents/web_intents_registry.h" | 8 #include "chrome/browser/intents/web_intents_registry.h" |
| 9 #include "chrome/browser/webdata/web_data_service.h" | 9 #include "chrome/browser/webdata/web_data_service.h" |
| 10 #include "chrome/test/testing_browser_process_test.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 class WebIntentsRegistryTest : public testing::Test { | 13 class WebIntentsRegistryTest : public TestingBrowserProcessTest { |
| 13 public: | 14 public: |
| 14 WebIntentsRegistryTest() | 15 WebIntentsRegistryTest() |
| 15 : ui_thread_(BrowserThread::UI, &message_loop_), | 16 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 16 db_thread_(BrowserThread::DB) {} | 17 db_thread_(BrowserThread::DB) {} |
| 17 | 18 |
| 18 protected: | 19 protected: |
| 19 virtual void SetUp() { | 20 virtual void SetUp() { |
| 20 db_thread_.Start(); | 21 db_thread_.Start(); |
| 21 wds_ = new WebDataService(); | 22 wds_ = new WebDataService(); |
| 22 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 23 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 93 |
| 93 intent.action = ASCIIToUTF16("share"); | 94 intent.action = ASCIIToUTF16("share"); |
| 94 intent.type = ASCIIToUTF16("image/*"); | 95 intent.type = ASCIIToUTF16("image/*"); |
| 95 registry_.UnregisterIntentProvider(intent); | 96 registry_.UnregisterIntentProvider(intent); |
| 96 | 97 |
| 97 consumer.expected_id_ = registry_.GetIntentProviders(ASCIIToUTF16("share"), | 98 consumer.expected_id_ = registry_.GetIntentProviders(ASCIIToUTF16("share"), |
| 98 &consumer); | 99 &consumer); |
| 99 consumer.WaitForData(); | 100 consumer.WaitForData(); |
| 100 EXPECT_EQ(1U, consumer.intents_.size()); | 101 EXPECT_EQ(1U, consumer.intents_.size()); |
| 101 } | 102 } |
| OLD | NEW |