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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
30 | 30 |
31 using base::WaitableEvent; | 31 using base::WaitableEvent; |
32 using content::BrowserThread; | 32 using content::BrowserThread; |
33 using testing::_; | 33 using testing::_; |
34 using testing::DoAll; | 34 using testing::DoAll; |
35 using testing::ElementsAreArray; | 35 using testing::ElementsAreArray; |
36 using testing::Pointee; | 36 using testing::Pointee; |
37 using testing::Property; | 37 using testing::Property; |
38 using testing::WithArg; | 38 using testing::WithArg; |
39 using webkit_glue::PasswordForm; | 39 using webkit::forms::PasswordForm; |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 class MockPasswordStoreConsumer : public PasswordStoreConsumer { | 43 class MockPasswordStoreConsumer : public PasswordStoreConsumer { |
44 public: | 44 public: |
45 MOCK_METHOD2(OnPasswordStoreRequestDone, | 45 MOCK_METHOD2(OnPasswordStoreRequestDone, |
46 void(CancelableRequestProvider::Handle, | 46 void(CancelableRequestProvider::Handle, |
47 const std::vector<webkit_glue::PasswordForm*>&)); | 47 const std::vector<webkit::forms::PasswordForm*>&)); |
48 }; | 48 }; |
49 | 49 |
50 class MockWebDataServiceConsumer : public WebDataServiceConsumer { | 50 class MockWebDataServiceConsumer : public WebDataServiceConsumer { |
51 public: | 51 public: |
52 MOCK_METHOD2(OnWebDataServiceRequestDone, void(WebDataService::Handle, | 52 MOCK_METHOD2(OnWebDataServiceRequestDone, void(WebDataService::Handle, |
53 const WDTypedResult*)); | 53 const WDTypedResult*)); |
54 }; | 54 }; |
55 | 55 |
56 // This class will add and remove a mock notification observer from | 56 // This class will add and remove a mock notification observer from |
57 // the DB thread. | 57 // the DB thread. |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 // Deleting the login should trigger a notification. | 519 // Deleting the login should trigger a notification. |
520 store->RemoveLogin(*form); | 520 store->RemoveLogin(*form); |
521 | 521 |
522 // Wait for PasswordStore to send the notification. | 522 // Wait for PasswordStore to send the notification. |
523 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 523 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
524 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); | 524 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); |
525 done.Wait(); | 525 done.Wait(); |
526 | 526 |
527 store->Shutdown(); | 527 store->Shutdown(); |
528 } | 528 } |
OLD | NEW |