| Index: chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc
|
| diff --git a/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc b/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc
|
| index 935b36ddf18f72d0629f173ee3925b9aedd2bef0..452631f7358db69c8bc49c57058f821c34cf3fa1 100644
|
| --- a/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc
|
| +++ b/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc
|
| @@ -27,6 +27,7 @@
|
| #include "chrome/browser/safe_browsing/srt_client_info_win.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| +#include "chrome/browser/ui/test/test_browser_dialog.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| #include "components/component_updater/pref_names.h"
|
| @@ -267,6 +268,19 @@ class SRTFetcherTest : public InProcessBrowserTest,
|
| base::OnceClosure first_launch_callback_;
|
| };
|
|
|
| +class SRTFetcherPromptTest : public DialogBrowserTest {
|
| + public:
|
| + void ShowDialog(const std::string& name) override {
|
| + if (name == "SRTErrorNoFile")
|
| + DisplaySRTPromptForTesting(base::FilePath());
|
| + else if (name == "SRTErrorFile")
|
| + DisplaySRTPromptForTesting(
|
| + base::FilePath().Append(FILE_PATH_LITERAL("c:\temp\testfile.txt")));
|
| + else
|
| + ADD_FAILURE() << "Unknown dialog type.";
|
| + }
|
| +};
|
| +
|
| } // namespace
|
|
|
| IN_PROC_BROWSER_TEST_F(SRTFetcherTest, NothingFound) {
|
| @@ -578,4 +592,16 @@ IN_PROC_BROWSER_TEST_F(SRTFetcherTest, ReporterLogging_MultipleLaunches) {
|
| ExpectToRunAgain(kDaysBetweenSuccessfulSwReporterRuns);
|
| }
|
|
|
| +// This provide tests which allows explicit invocation of the SRT Prompt
|
| +// useful for checking dialog layout or any other interactive functionality
|
| +// tests. See docs/testing/test_browser_dialog.md for description of the
|
| +// testing framework.
|
| +IN_PROC_BROWSER_TEST_F(SRTFetcherPromptTest, InvokeDialog_SRTErrorNoFile) {
|
| + RunDialog();
|
| +}
|
| +
|
| +IN_PROC_BROWSER_TEST_F(SRTFetcherPromptTest, InvokeDialog_SRTErrorFile) {
|
| + RunDialog();
|
| +}
|
| +
|
| } // namespace safe_browsing
|
|
|