| OLD | NEW | 
|    1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ |    5 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ | 
|    6 #define CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ |    6 #define CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ | 
|    7 #pragma once |    7 #pragma once | 
|    8  |    8  | 
|    9 #include <set> |    9 #include <set> | 
|   10  |   10  | 
|   11 #include "chrome/browser/profiles/profile.h" |   11 #include "chrome/browser/profiles/profile.h" | 
 |   12 #include "chrome/browser/password_manager/password_store_consumer.h" | 
|   12 #include "chrome/browser/password_manager/password_store.h" |   13 #include "chrome/browser/password_manager/password_store.h" | 
|   13 #include "chrome/test/live_sync/live_sync_test.h" |   14 #include "chrome/test/live_sync/live_sync_test.h" | 
|   14 #include "chrome/test/ui_test_utils.h" |   15 #include "chrome/test/ui_test_utils.h" | 
|   15 #include "chrome/test/signaling_task.h" |   16 #include "chrome/test/signaling_task.h" | 
|   16 #include "webkit/glue/password_form.h" |   17 #include "webkit/glue/password_form.h" | 
|   17  |   18  | 
|   18 class LivePasswordsSyncTest : public LiveSyncTest { |   19 class LivePasswordsSyncTest : public LiveSyncTest { | 
|   19  public: |   20  public: | 
|   20   explicit LivePasswordsSyncTest(TestType test_type) |   21   explicit LivePasswordsSyncTest(TestType test_type) | 
|   21       : LiveSyncTest(test_type) {} |   22       : LiveSyncTest(test_type) {} | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   57   } |   58   } | 
|   58  |   59  | 
|   59  private: |   60  private: | 
|   60   class PasswordStoreConsumerHelper : public PasswordStoreConsumer { |   61   class PasswordStoreConsumerHelper : public PasswordStoreConsumer { | 
|   61    public: |   62    public: | 
|   62     explicit PasswordStoreConsumerHelper( |   63     explicit PasswordStoreConsumerHelper( | 
|   63         std::vector<webkit_glue::PasswordForm>& result) |   64         std::vector<webkit_glue::PasswordForm>& result) | 
|   64         : PasswordStoreConsumer(), result_(result) {} |   65         : PasswordStoreConsumer(), result_(result) {} | 
|   65  |   66  | 
|   66     virtual void OnPasswordStoreRequestDone( |   67     virtual void OnPasswordStoreRequestDone( | 
|   67         int handle, const std::vector<webkit_glue::PasswordForm*>& result) { |   68         CancelableRequestProvider::Handle handle, | 
 |   69         const std::vector<webkit_glue::PasswordForm*>& result) { | 
|   68       result_.clear(); |   70       result_.clear(); | 
|   69       for (std::vector<webkit_glue::PasswordForm*>::const_iterator it = |   71       for (std::vector<webkit_glue::PasswordForm*>::const_iterator it = | 
|   70            result.begin(); it != result.end(); ++it) { |   72            result.begin(); it != result.end(); ++it) { | 
|   71         // Make a copy of the form since it gets deallocated after the caller of |   73         // Make a copy of the form since it gets deallocated after the caller of | 
|   72         // this method returns. |   74         // this method returns. | 
|   73         result_.push_back(**it); |   75         result_.push_back(**it); | 
|   74       } |   76       } | 
|   75       MessageLoopForUI::current()->Quit(); |   77       MessageLoopForUI::current()->Quit(); | 
|   76     } |   78     } | 
|   77  |   79  | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  116 class ManyClientLivePasswordsSyncTest : public LivePasswordsSyncTest { |  118 class ManyClientLivePasswordsSyncTest : public LivePasswordsSyncTest { | 
|  117  public: |  119  public: | 
|  118   ManyClientLivePasswordsSyncTest() : LivePasswordsSyncTest(MANY_CLIENT) {} |  120   ManyClientLivePasswordsSyncTest() : LivePasswordsSyncTest(MANY_CLIENT) {} | 
|  119   virtual ~ManyClientLivePasswordsSyncTest() {} |  121   virtual ~ManyClientLivePasswordsSyncTest() {} | 
|  120  |  122  | 
|  121  private: |  123  private: | 
|  122   DISALLOW_COPY_AND_ASSIGN(ManyClientLivePasswordsSyncTest); |  124   DISALLOW_COPY_AND_ASSIGN(ManyClientLivePasswordsSyncTest); | 
|  123 }; |  125 }; | 
|  124  |  126  | 
|  125 #endif  // CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ |  127 #endif  // CHROME_TEST_LIVE_SYNC_LIVE_PASSWORDS_SYNC_TEST_H_ | 
| OLD | NEW |