OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "android_webview/browser/aw_form_database_service.h" | 5 #include "android_webview/browser/aw_form_database_service.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 db_thread_.Start(); | 33 db_thread_.Start(); |
34 } | 34 } |
35 | 35 |
36 protected: | 36 protected: |
37 void SetUp() override { | 37 void SetUp() override { |
38 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 38 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
39 env_ = AttachCurrentThread(); | 39 env_ = AttachCurrentThread(); |
40 ASSERT_TRUE(env_ != NULL); | 40 ASSERT_TRUE(env_ != NULL); |
41 ASSERT_TRUE(l10n_util::RegisterLocalizationUtil(env_)); | 41 ASSERT_TRUE(l10n_util::RegisterLocalizationUtil(env_)); |
42 | 42 |
43 service_.reset(new AwFormDatabaseService(temp_dir_.path())); | 43 service_.reset(new AwFormDatabaseService(temp_dir_.GetPath())); |
44 } | 44 } |
45 | 45 |
46 void TearDown() override { service_->Shutdown(); } | 46 void TearDown() override { service_->Shutdown(); } |
47 | 47 |
48 // The path to the temporary directory used for the test operations. | 48 // The path to the temporary directory used for the test operations. |
49 base::ScopedTempDir temp_dir_; | 49 base::ScopedTempDir temp_dir_; |
50 // A message loop for UI thread. | 50 // A message loop for UI thread. |
51 base::MessageLoop message_loop_; | 51 base::MessageLoop message_loop_; |
52 content::TestBrowserThread ui_thread_; | 52 content::TestBrowserThread ui_thread_; |
53 content::TestBrowserThread db_thread_; | 53 content::TestBrowserThread db_thread_; |
(...skipping 11 matching lines...) Expand all Loading... |
65 field.name = base::ASCIIToUTF16("foo"); | 65 field.name = base::ASCIIToUTF16("foo"); |
66 field.value = base::ASCIIToUTF16("bar"); | 66 field.value = base::ASCIIToUTF16("bar"); |
67 fields.push_back(field); | 67 fields.push_back(field); |
68 service_->get_autofill_webdata_service()->AddFormFields(fields); | 68 service_->get_autofill_webdata_service()->AddFormFields(fields); |
69 EXPECT_TRUE(service_->HasFormData()); | 69 EXPECT_TRUE(service_->HasFormData()); |
70 service_->ClearFormData(); | 70 service_->ClearFormData(); |
71 EXPECT_FALSE(service_->HasFormData()); | 71 EXPECT_FALSE(service_->HasFormData()); |
72 } | 72 } |
73 | 73 |
74 } // namespace android_webview | 74 } // namespace android_webview |
OLD | NEW |