OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 #include "base/test/scoped_feature_list.h" | 6 #include "base/test/scoped_feature_list.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h" | 8 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h" |
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
10 #include "chrome/common/chrome_features.h" | 10 #include "chrome/common/chrome_features.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 // Show a dialog. | 28 // Show a dialog. |
29 | 29 |
30 scoped_refptr<content::MessageLoopRunner> runner = | 30 scoped_refptr<content::MessageLoopRunner> runner = |
31 new content::MessageLoopRunner; | 31 new content::MessageLoopRunner; |
32 js_helper->SetDialogShownCallbackForTesting(runner->QuitClosure()); | 32 js_helper->SetDialogShownCallbackForTesting(runner->QuitClosure()); |
33 tab->GetMainFrame()->ExecuteJavaScriptForTests(base::UTF8ToUTF16("alert()")); | 33 tab->GetMainFrame()->ExecuteJavaScriptForTests(base::UTF8ToUTF16("alert()")); |
34 runner->Run(); | 34 runner->Run(); |
35 | 35 |
36 // Try reloading. | 36 // Try reloading. |
37 | 37 |
38 tab->GetController().Reload(false); | 38 tab->GetController().Reload(content::ReloadType::NORMAL, false); |
Takashi Toyoshima
2016/12/15 06:21:52
testing
| |
39 content::WaitForLoadStop(tab); | 39 content::WaitForLoadStop(tab); |
40 | 40 |
41 // If the WaitForLoadStop doesn't hang forever, we've passed. | 41 // If the WaitForLoadStop doesn't hang forever, we've passed. |
42 } | 42 } |
OLD | NEW |