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" |
11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/scoped_temp_dir.h" | 13 #include "base/scoped_temp_dir.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
18 #include "base/time.h" | 18 #include "base/time.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "chrome/browser/autofill/autofill_profile.h" | 20 #include "chrome/browser/autofill/autofill_profile.h" |
21 #include "chrome/browser/autofill/credit_card.h" | 21 #include "chrome/browser/autofill/credit_card.h" |
22 #include "chrome/browser/webdata/autofill_change.h" | 22 #include "chrome/browser/webdata/autofill_change.h" |
23 #include "chrome/browser/webdata/autofill_entry.h" | 23 #include "chrome/browser/webdata/autofill_entry.h" |
24 #include "chrome/browser/webdata/web_data_service.h" | 24 #include "chrome/browser/webdata/web_data_service.h" |
25 #include "chrome/browser/webdata/web_data_service_test_util.h" | 25 #include "chrome/browser/webdata/web_data_service_test_util.h" |
26 #include "chrome/browser/webdata/web_intents_table.h" | 26 #include "chrome/browser/webdata/web_intents_table.h" |
27 #include "chrome/common/chrome_notification_types.h" | 27 #include "chrome/common/chrome_notification_types.h" |
28 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
29 #include "chrome/common/guid.h" | 29 #include "chrome/common/guid.h" |
30 #include "chrome/test/base/testing_browser_process_test.h" | |
31 #include "chrome/test/base/thread_observer_helper.h" | 30 #include "chrome/test/base/thread_observer_helper.h" |
32 #include "content/browser/browser_thread.h" | 31 #include "content/browser/browser_thread.h" |
33 #include "content/common/notification_details.h" | 32 #include "content/common/notification_details.h" |
34 #include "content/common/notification_service.h" | 33 #include "content/common/notification_service.h" |
35 #include "testing/gmock/include/gmock/gmock.h" | 34 #include "testing/gmock/include/gmock/gmock.h" |
36 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
37 #include "webkit/glue/form_field.h" | 36 #include "webkit/glue/form_field.h" |
38 | 37 |
39 using base::Time; | 38 using base::Time; |
40 using base::TimeDelta; | 39 using base::TimeDelta; |
(...skipping 20 matching lines...) Expand all Loading... |
61 NotificationService::AllSources()); | 60 NotificationService::AllSources()); |
62 registrar_.Add(&observer_, | 61 registrar_.Add(&observer_, |
63 chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, | 62 chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, |
64 NotificationService::AllSources()); | 63 NotificationService::AllSources()); |
65 registrar_.Add(&observer_, | 64 registrar_.Add(&observer_, |
66 chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED, | 65 chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED, |
67 NotificationService::AllSources()); | 66 NotificationService::AllSources()); |
68 } | 67 } |
69 }; | 68 }; |
70 | 69 |
71 class WebDataServiceTest : public TestingBrowserProcessTest { | 70 class WebDataServiceTest : public testing::Test { |
72 public: | 71 public: |
73 WebDataServiceTest() | 72 WebDataServiceTest() |
74 : ui_thread_(BrowserThread::UI, &message_loop_), | 73 : ui_thread_(BrowserThread::UI, &message_loop_), |
75 db_thread_(BrowserThread::DB) {} | 74 db_thread_(BrowserThread::DB) {} |
76 | 75 |
77 protected: | 76 protected: |
78 virtual void SetUp() { | 77 virtual void SetUp() { |
79 db_thread_.Start(); | 78 db_thread_.Start(); |
80 | 79 |
81 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 80 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 ASSERT_EQ(2U, consumer.intents.size()); | 654 ASSERT_EQ(2U, consumer.intents.size()); |
656 | 655 |
657 if (consumer.intents[0].action != ASCIIToUTF16("edit")) | 656 if (consumer.intents[0].action != ASCIIToUTF16("edit")) |
658 std::swap(consumer.intents[0],consumer.intents[1]); | 657 std::swap(consumer.intents[0],consumer.intents[1]); |
659 | 658 |
660 EXPECT_EQ(intent, consumer.intents[0]); | 659 EXPECT_EQ(intent, consumer.intents[0]); |
661 intent.action = ASCIIToUTF16("share"); | 660 intent.action = ASCIIToUTF16("share"); |
662 EXPECT_EQ(intent, consumer.intents[1]); | 661 EXPECT_EQ(intent, consumer.intents[1]); |
663 } | 662 } |
664 | 663 |
OLD | NEW |