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

Unified Diff: chrome/browser/ui/webui/web_ui_browsertest.cc

Issue 7087014: Support automatic javascript test registry in gtest when creating WebUI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment to WebUIBrowserTestPass and use optparse.exit instead of exit. Created 9 years, 6 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
Index: chrome/browser/ui/webui/web_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/web_ui_browsertest.cc b/chrome/browser/ui/webui/web_ui_browsertest.cc
index 3817612619a61c8a7daf4884bbc5cab12a9f0e53..819ee5c602f59955fbbe08457330bc0e197dc2dd 100644
--- a/chrome/browser/ui/webui/web_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/web_ui_browsertest.cc
@@ -204,3 +204,18 @@ IN_PROC_BROWSER_TEST_F(WebUIBrowserTest, TestSamplePass) {
ASSERT_TRUE(RunJavascriptTest("testInitialFocus"));
ASSERT_FALSE(RunJavascriptTest("testConsoleError"));
}
+
+// This test framework is used in the generated tests, which are included below.
+class WebUIBrowserTestPass : public WebUIBrowserTest {
+ private:
+ // Because the inline file will be generated to call the javascript methods
+ // via RunJavascriptTest, we need to do any preliminary setup in this method.
+ // Note: WebUIBrowserTest doesn't override setup, so no need to call its
+ // SetupOnMainThread().
+ virtual void SetUpOnMainThread() OVERRIDE {
+ ui_test_utils::NavigateToURL(browser(),
+ GURL(chrome::kChromeUIDownloadsURL));
Paweł Hajdan Jr. 2011/06/15 08:12:31 The comments don't explain why we're navigating to
Sheridan Rawlins 2011/06/15 23:54:32 Ok, I made a dummy page and navigate to there inst
+ }
+};
+
+#include "chrome/browser/ui/webui/web_ui_browsertest-inl.h"

Powered by Google App Engine
This is Rietveld 408576698