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 "components/autofill/browser/risk/fingerprint.h" | 5 #include "components/autofill/browser/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 "chrome/browser/browser_process.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "components/autofill/browser/risk/proto/fingerprint.pb.h" | 12 #include "components/autofill/browser/risk/proto/fingerprint.pb.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebScreenInfo.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebScreenInfo.h" |
15 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
16 | 17 |
17 namespace autofill { | 18 namespace autofill { |
18 namespace risk { | 19 namespace risk { |
19 | 20 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Test that getting a fingerprint works on some basic level. | 124 // Test that getting a fingerprint works on some basic level. |
124 IN_PROC_BROWSER_TEST_F(AutofillRiskFingerprintTest, MAYBE_GetFingerprint) { | 125 IN_PROC_BROWSER_TEST_F(AutofillRiskFingerprintTest, MAYBE_GetFingerprint) { |
125 WebKit::WebScreenInfo screen_info; | 126 WebKit::WebScreenInfo screen_info; |
126 screen_info.depth = kScreenColorDepth; | 127 screen_info.depth = kScreenColorDepth; |
127 screen_info.rect = WebKit::WebRect(kScreenBounds); | 128 screen_info.rect = WebKit::WebRect(kScreenBounds); |
128 screen_info.availableRect = WebKit::WebRect(kAvailableScreenBounds); | 129 screen_info.availableRect = WebKit::WebRect(kAvailableScreenBounds); |
129 | 130 |
130 internal::GetFingerprintInternal( | 131 internal::GetFingerprintInternal( |
131 kGaiaId, kWindowBounds, kContentBounds, screen_info, "25.0.0.123", | 132 kGaiaId, kWindowBounds, kContentBounds, screen_info, "25.0.0.123", |
132 kCharset, kAcceptLanguages, base::Time::Now(), DIALOG_TYPE_AUTOCHECKOUT, | 133 kCharset, kAcceptLanguages, base::Time::Now(), DIALOG_TYPE_AUTOCHECKOUT, |
| 134 g_browser_process->GetApplicationLocale(), |
133 base::Bind(&AutofillRiskFingerprintTest::GetFingerprintTestCallback, | 135 base::Bind(&AutofillRiskFingerprintTest::GetFingerprintTestCallback, |
134 base::Unretained(this))); | 136 base::Unretained(this))); |
135 | 137 |
136 // Wait for the callback to be called. | 138 // Wait for the callback to be called. |
137 message_loop_.Run(); | 139 message_loop_.Run(); |
138 } | 140 } |
139 | 141 |
140 } // namespace risk | 142 } // namespace risk |
141 } // namespace autofill | 143 } // namespace autofill |
OLD | NEW |