OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/autofill/risk/fingerprint.h" | 5 #include "chrome/browser/autofill/risk/fingerprint.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/port.h" | 9 #include "base/port.h" |
10 #include "base/prefs/public/pref_service_base.h" | 10 #include "base/prefs/public/pref_service_base.h" |
11 #include "chrome/browser/autofill/risk/proto/fingerprint.pb.h" | 11 #include "chrome/browser/autofill/risk/proto/fingerprint.pb.h" |
| 12 #include "chrome/browser/prefs/pref_registry_simple.h" |
12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "chrome/test/base/testing_pref_service.h" | 15 #include "chrome/test/base/testing_pref_service.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
17 | 18 |
18 namespace autofill { | 19 namespace autofill { |
19 namespace risk { | 20 namespace risk { |
20 | 21 |
21 const int64 kGaiaId = GG_INT64_C(99194853094755497); | 22 const int64 kGaiaId = GG_INT64_C(99194853094755497); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 91 |
91 protected: | 92 protected: |
92 const gfx::Rect kWindowBounds; | 93 const gfx::Rect kWindowBounds; |
93 const gfx::Rect kContentBounds; | 94 const gfx::Rect kContentBounds; |
94 MessageLoop message_loop_; | 95 MessageLoop message_loop_; |
95 }; | 96 }; |
96 | 97 |
97 // Test that getting a fingerprint works on some basic level. | 98 // Test that getting a fingerprint works on some basic level. |
98 IN_PROC_BROWSER_TEST_F(AutofillRiskFingerprintTest, GetFingerprint) { | 99 IN_PROC_BROWSER_TEST_F(AutofillRiskFingerprintTest, GetFingerprint) { |
99 TestingPrefServiceSimple prefs; | 100 TestingPrefServiceSimple prefs; |
100 prefs.RegisterStringPref(prefs::kDefaultCharset, kCharset); | 101 prefs.registry()->RegisterStringPref(prefs::kDefaultCharset, kCharset); |
101 prefs.RegisterStringPref(prefs::kAcceptLanguages, kAcceptLanguages); | 102 prefs.registry()->RegisterStringPref(prefs::kAcceptLanguages, |
| 103 kAcceptLanguages); |
102 | 104 |
103 GetFingerprint( | 105 GetFingerprint( |
104 kGaiaId, kWindowBounds, kContentBounds, prefs, | 106 kGaiaId, kWindowBounds, kContentBounds, prefs, |
105 base::Bind(&AutofillRiskFingerprintTest::GetFingerprintTestCallback, | 107 base::Bind(&AutofillRiskFingerprintTest::GetFingerprintTestCallback, |
106 base::Unretained(this))); | 108 base::Unretained(this))); |
107 | 109 |
108 // Wait for the callback to be called. | 110 // Wait for the callback to be called. |
109 message_loop_.Run(); | 111 message_loop_.Run(); |
110 } | 112 } |
111 | 113 |
112 } // namespace risk | 114 } // namespace risk |
113 } // namespace autofill | 115 } // namespace autofill |
OLD | NEW |