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

Unified Diff: chrome/browser/browser_uitest.cc

Issue 2847032: Add a simple UI test for --app mode. (Closed)
Patch Set: Fixes Created 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_uitest.cc
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc
index 8efef73f48d67cff1d7c5a548b37ca9695ce45a7..eb66e13f6633d4c826c420b99ba76ed00d0ce5d1 100644
--- a/chrome/browser/browser_uitest.cc
+++ b/chrome/browser/browser_uitest.cc
@@ -9,6 +9,7 @@
#include "base/test/test_file_util.h"
#include "base/values.h"
#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/browser/browser.h"
#include "chrome/browser/platform_util.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_constants.h"
@@ -245,7 +246,7 @@ class KioskModeTest : public UITest {
};
TEST_F(KioskModeTest, EnableKioskModeTest) {
- // Load a dummy url.
+ // Load a local file.
FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title1.html");
@@ -302,4 +303,30 @@ TEST_F(LaunchBrowserWithNonAsciiUserDatadir, TestNonAsciiUserDataDir) {
}
#endif // defined(OS_WIN)
+class AppModeTest : public UITest {
+ public:
+ AppModeTest() {
+ // Load a local file.
+ FilePath test_file(test_data_directory_);
+ test_file = test_file.AppendASCII("title1.html");
+ GURL test_file_url(net::FilePathToFileURL(test_file));
+
+ launch_arguments_.AppendSwitchWithValue(switches::kApp,
+ test_file_url.spec());
+ }
+};
+
+TEST_F(AppModeTest, EnableAppModeTest) {
+ // Test that an application browser window loads correctly.
+
+ // Verify that the window is present.
+ scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser.get());
+
+ // Verify the browser is an application.
+ Browser::Type type;
+ ASSERT_TRUE(browser->GetType(&type));
+ EXPECT_EQ(Browser::TYPE_APP, type);
+}
+
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698