OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/test/histogram_tester.h" | 9 #include "base/test/histogram_tester.h" |
10 #include "chrome/test/base/chrome_render_view_test.h" | 10 #include "chrome/test/base/chrome_render_view_test.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 // Loading a different page triggers UMA stat upload. Verify that only one | 336 // Loading a different page triggers UMA stat upload. Verify that only one |
337 // display event is sent even though | 337 // display event is sent even though |
338 LoadHTML(kSigninFormHTML); | 338 LoadHTML(kSigninFormHTML); |
339 | 339 |
340 histogram_tester.ExpectBucketCount( | 340 histogram_tester.ExpectBucketCount( |
341 "PasswordGeneration.Event", | 341 "PasswordGeneration.Event", |
342 autofill::password_generation::GENERATION_POPUP_SHOWN, | 342 autofill::password_generation::GENERATION_POPUP_SHOWN, |
343 1); | 343 1); |
344 } | 344 } |
345 | 345 |
346 TEST_F(PasswordGenerationAgentTest, DynamicFormTest) { | |
347 LoadHTML(kSigninFormHTML); | |
348 SetNotBlacklistedMessage(kSigninFormHTML); | |
349 SetAccountCreationFormsDetectedMessage(kSigninFormHTML); | |
350 | |
351 ExecuteJavaScript( | |
352 "var form = document.createElement('form');" | |
353 "var username = document.createElement('input');" | |
354 "username.type = 'text';" | |
355 "username.id = 'dynamic_username';" | |
356 "var first_password = document.createElement('input');" | |
357 "first_password.type = 'password';" | |
358 "first_password.id = 'first_password';" | |
359 "first_password.name = 'first_password';" | |
360 "var second_password = document.createElement('input');" | |
361 "second_password.type = 'password';" | |
362 "second_password.id = 'second_password';" | |
363 "second_password.name = 'second_password';" | |
364 "form.appendChild(username);" | |
365 "form.appendChild(first_password);" | |
366 "form.appendChild(second_password);" | |
367 "document.body.appendChild(form);"); | |
368 ProcessPendingMessages(); | |
Garrett Casto
2014/10/15 22:11:45
I'm slightly worried that this might flake because
vabr (Chromium)
2014/10/16 07:46:15
If it does not flake during tryjobs and in the tre
Garrett Casto
2014/10/16 19:14:06
Added a comment. I've run this over 200 times loca
| |
369 ExpectPasswordGenerationAvailable("first_password", true); | |
370 } | |
371 | |
346 } // namespace autofill | 372 } // namespace autofill |
OLD | NEW |