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

Unified Diff: chrome/browser/first_run/try_chrome_dialog_view_browsertest.cc

Issue 2816293002: Description: Replace layout constants in chrome/browser/extensions and chrome/browser/first_run (Closed)
Patch Set: Address review comments Created 3 years, 8 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 | « chrome/browser/first_run/try_chrome_dialog_view.cc ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/try_chrome_dialog_view_browsertest.cc
diff --git a/chrome/browser/first_run/try_chrome_dialog_view_browsertest.cc b/chrome/browser/first_run/try_chrome_dialog_view_browsertest.cc
index 7cfa862658e5780dbe81452076b308ebee6949a3..448c399e7d32a02ccd6700570614b02b4ff695a7 100644
--- a/chrome/browser/first_run/try_chrome_dialog_view_browsertest.cc
+++ b/chrome/browser/first_run/try_chrome_dialog_view_browsertest.cc
@@ -4,9 +4,11 @@
#include "base/command_line.h"
#include "build/build_config.h"
+#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "ui/base/ui_base_switches.h"
// Unfortunately, this needs to be Windows only for now. Even though this test
// is meant to exercise code that is for Windows only, it is a good general
@@ -16,6 +18,7 @@
// will be improved to support this so we can get coverage on other platforms.
// See http://crbug.com/45115 for details.
#if defined(OS_WIN)
+#include "chrome/browser/ui/views/try_chrome_dialog_view.h"
// By passing kTryChromeAgain with a magic value > 10000 we cause Chrome
// to exit fairly early.
@@ -55,4 +58,35 @@ protected:
// only makes the problem worse.
IN_PROC_BROWSER_TEST_F(TryChromeDialogBrowserTest, ToastCrasher) {}
+// Helper class to display the TryChromeDialog for testing.
+class TryChromeDialogTest : public DialogBrowserTest {
+ public:
+ // TODO(ananta)
+ // Provide a way to test flavors other than 0.
+ TryChromeDialogTest() : dialog_(0) {}
+
+ static void DialogHandler(gfx::NativeWindow active_dialog) {}
+
+ // DialogBrowserTest:
+ void ShowDialog(const std::string& name) override {
+ dialog_.ShowDialog(base::Bind(&TryChromeDialogTest::DialogHandler),
+ TryChromeDialogView::kDialogType::MODELESS,
+ TryChromeDialogView::kUsageType::FOR_TESTING);
+ }
+
+ // content::BrowserTestBase:
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ command_line->AppendSwitch(switches::kExtendMdToSecondaryUi);
+ }
+
+ private:
+ TryChromeDialogView dialog_;
+
+ DISALLOW_COPY_AND_ASSIGN(TryChromeDialogTest);
+};
+
+IN_PROC_BROWSER_TEST_F(TryChromeDialogTest, InvokeDialog_default) {
+ RunDialog();
+}
+
#endif // defined(OS_WIN)
« no previous file with comments | « chrome/browser/first_run/try_chrome_dialog_view.cc ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698