OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/content/browser/risk/fingerprint.h" | 5 #include "components/autofill/content/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/browser/browser_process.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 const gfx::Rect window_bounds_; | 162 const gfx::Rect window_bounds_; |
163 const gfx::Rect content_bounds_; | 163 const gfx::Rect content_bounds_; |
164 const gfx::Rect screen_bounds_; | 164 const gfx::Rect screen_bounds_; |
165 const gfx::Rect available_screen_bounds_; | 165 const gfx::Rect available_screen_bounds_; |
166 const gfx::Rect unavailable_screen_bounds_; | 166 const gfx::Rect unavailable_screen_bounds_; |
167 | 167 |
168 // A message loop to block on the asynchronous loading of the fingerprint. | 168 // A message loop to block on the asynchronous loading of the fingerprint. |
169 base::MessageLoop message_loop_; | 169 base::MessageLoop message_loop_; |
170 }; | 170 }; |
171 | 171 |
172 // This test is flaky on Windows. See http://crbug.com/178356. | |
173 #if defined(OS_WIN) | |
174 #define MAYBE_GetFingerprint DISABLED_GetFingerprint | |
175 #else | |
176 #define MAYBE_GetFingerprint GetFingerprint | |
177 #endif | |
178 // Test that getting a fingerprint works on some basic level. | 172 // Test that getting a fingerprint works on some basic level. |
179 IN_PROC_BROWSER_TEST_F(AutofillRiskFingerprintTest, MAYBE_GetFingerprint) { | 173 IN_PROC_BROWSER_TEST_F(AutofillRiskFingerprintTest, GetFingerprint) { |
180 content::Geoposition position; | 174 content::Geoposition position; |
181 position.latitude = kLatitude; | 175 position.latitude = kLatitude; |
182 position.longitude = kLongitude; | 176 position.longitude = kLongitude; |
183 position.altitude = kAltitude; | 177 position.altitude = kAltitude; |
184 position.accuracy = kAccuracy; | 178 position.accuracy = kAccuracy; |
185 position.timestamp = | 179 position.timestamp = |
186 base::Time::UnixEpoch() + | 180 base::Time::UnixEpoch() + |
187 base::TimeDelta::FromMilliseconds(kGeolocationTime); | 181 base::TimeDelta::FromMilliseconds(kGeolocationTime); |
188 scoped_refptr<content::MessageLoopRunner> runner = | 182 scoped_refptr<content::MessageLoopRunner> runner = |
189 new content::MessageLoopRunner; | 183 new content::MessageLoopRunner; |
(...skipping 12 matching lines...) Expand all Loading... |
202 DIALOG_TYPE_AUTOCHECKOUT, g_browser_process->GetApplicationLocale(), | 196 DIALOG_TYPE_AUTOCHECKOUT, g_browser_process->GetApplicationLocale(), |
203 base::Bind(&AutofillRiskFingerprintTest::GetFingerprintTestCallback, | 197 base::Bind(&AutofillRiskFingerprintTest::GetFingerprintTestCallback, |
204 base::Unretained(this))); | 198 base::Unretained(this))); |
205 | 199 |
206 // Wait for the callback to be called. | 200 // Wait for the callback to be called. |
207 message_loop_.Run(); | 201 message_loop_.Run(); |
208 } | 202 } |
209 | 203 |
210 } // namespace risk | 204 } // namespace risk |
211 } // namespace autofill | 205 } // namespace autofill |
OLD | NEW |