Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/browser/password_manager/password_store_mac_unittest.cc

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try works all platforms now. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "testing/gmock/include/gmock/gmock.h" 5 #include "testing/gmock/include/gmock/gmock.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 10 matching lines...) Expand all
21 using webkit_glue::PasswordForm; 21 using webkit_glue::PasswordForm;
22 using testing::_; 22 using testing::_;
23 using testing::DoAll; 23 using testing::DoAll;
24 using testing::WithArg; 24 using testing::WithArg;
25 25
26 namespace { 26 namespace {
27 27
28 class MockPasswordStoreConsumer : public PasswordStoreConsumer { 28 class MockPasswordStoreConsumer : public PasswordStoreConsumer {
29 public: 29 public:
30 MOCK_METHOD2(OnPasswordStoreRequestDone, 30 MOCK_METHOD2(OnPasswordStoreRequestDone,
31 void(int, const std::vector<webkit_glue::PasswordForm*>&)); 31 void(PasswordStore::Handle,
32 const std::vector<webkit_glue::PasswordForm*>&));
32 }; 33 };
33 34
34 ACTION(STLDeleteElements0) { 35 ACTION(STLDeleteElements0) {
35 STLDeleteContainerPointers(arg0.begin(), arg0.end()); 36 STLDeleteContainerPointers(arg0.begin(), arg0.end());
36 } 37 }
37 38
38 ACTION(QuitUIMessageLoop) { 39 ACTION(QuitUIMessageLoop) {
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
40 MessageLoop::current()->Quit(); 41 MessageLoop::current()->Quit();
41 } 42 }
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i; 1016 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i;
1016 } 1017 }
1017 STLDeleteElements(&matching_items); 1018 STLDeleteElements(&matching_items);
1018 1019
1019 login_db_->GetLogins(*query_form, &matching_items); 1020 login_db_->GetLogins(*query_form, &matching_items);
1020 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size()) 1021 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size())
1021 << "iteration " << i; 1022 << "iteration " << i;
1022 STLDeleteElements(&matching_items); 1023 STLDeleteElements(&matching_items);
1023 } 1024 }
1024 } 1025 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698