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

Unified Diff: chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc

Issue 2746223002: Harmony - update Chrome Cleanup tool prompt dialog. (Closed)
Patch Set: Added test with a file Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/srt_fetcher_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/srt_fetcher_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698