Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/password_manager/password_manager_browsertest.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram_samples.h" 8 #include "base/metrics/histogram_samples.h"
9 #include "base/metrics/statistics_recorder.h" 9 #include "base/metrics/statistics_recorder.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
11 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 11 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
12 #include "chrome/browser/infobars/infobar.h"
12 #include "chrome/browser/infobars/infobar_service.h" 13 #include "chrome/browser/infobars/infobar_service.h"
13 #include "chrome/browser/password_manager/password_store_factory.h" 14 #include "chrome/browser/password_manager/password_store_factory.h"
14 #include "chrome/browser/password_manager/test_password_store.h" 15 #include "chrome/browser/password_manager/test_password_store.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
17 #include "chrome/test/base/in_process_browser_test.h" 18 #include "chrome/test/base/in_process_browser_test.h"
18 #include "chrome/test/base/test_switches.h" 19 #include "chrome/test/base/test_switches.h"
19 #include "chrome/test/base/ui_test_utils.h" 20 #include "chrome/test/base/ui_test_utils.h"
20 #include "components/autofill/core/browser/autofill_test_utils.h" 21 #include "components/autofill/core/browser/autofill_test_utils.h"
21 #include "content/public/browser/notification_observer.h" 22 #include "content/public/browser/notification_observer.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // If a path is set, Wait() will return after this path has been seen, 58 // If a path is set, Wait() will return after this path has been seen,
58 // regardless of the frame that navigated. Useful for multi-frame pages. 59 // regardless of the frame that navigated. Useful for multi-frame pages.
59 void SetPathToWaitFor(const std::string& path) { 60 void SetPathToWaitFor(const std::string& path) {
60 wait_for_path_ = path; 61 wait_for_path_ = path;
61 } 62 }
62 63
63 // content::NotificationObserver: 64 // content::NotificationObserver:
64 virtual void Observe(int type, 65 virtual void Observe(int type,
65 const content::NotificationSource& source, 66 const content::NotificationSource& source,
66 const content::NotificationDetails& details) OVERRIDE { 67 const content::NotificationDetails& details) OVERRIDE {
67 infobar_service_->infobar_at(0)->AsConfirmInfoBarDelegate()->Accept(); 68 infobar_service_->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate()->
69 Accept();
68 infobar_shown_ = true; 70 infobar_shown_ = true;
69 } 71 }
70 72
71 // content::WebContentsObserver: 73 // content::WebContentsObserver:
72 virtual void DidFinishLoad( 74 virtual void DidFinishLoad(
73 int64 frame_id, 75 int64 frame_id,
74 const GURL& validated_url, 76 const GURL& validated_url,
75 bool is_main_frame, 77 bool is_main_frame,
76 content::RenderViewHost* render_view_host) OVERRIDE { 78 content::RenderViewHost* render_view_host) OVERRIDE {
77 if (!wait_for_path_.empty()) { 79 if (!wait_for_path_.empty()) {
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 "document.getElementById('username_field').value = 'temp';" 463 "document.getElementById('username_field').value = 'temp';"
462 "document.getElementById('password_field').value = 'random';" 464 "document.getElementById('password_field').value = 'random';"
463 "document.getElementById('input_submit_button').click();" 465 "document.getElementById('input_submit_button').click();"
464 "window.location.href = 'done.html';"; 466 "window.location.href = 'done.html';";
465 467
466 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), save_and_remove)); 468 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), save_and_remove));
467 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), navigate_frame)); 469 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), navigate_frame));
468 observer.Wait(); 470 observer.Wait();
469 // The only thing we check here is that there is no use-after-free reported. 471 // The only thing we check here is that there is no use-after-free reported.
470 } 472 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698