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

Unified Diff: chrome/browser/chromeos/login/eula_browsertest.cc

Issue 14746014: CrOS EULA: added 2 browser tests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 7 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/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/eula_browsertest.cc
diff --git a/chrome/browser/chromeos/login/eula_browsertest.cc b/chrome/browser/chromeos/login/eula_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b6cdc7126fb279fcfebb8cae4c1fd2b312c7981d
--- /dev/null
+++ b/chrome/browser/chromeos/login/eula_browsertest.cc
@@ -0,0 +1,50 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "net/dns/mock_host_resolver.h"
+
+namespace {
+
+const char kOfflineMessage[] = "The terms posted online may be updated"
+ " from time to time";
+
+class TermsOfServiceProcessBrowserTest : public InProcessBrowserTest {
+};
+
+// Load chrome://terms. Make sure online version is shown.
+IN_PROC_BROWSER_TEST_F(TermsOfServiceProcessBrowserTest, LoadOnline) {
+ ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUITermsURL));
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_EQ(0, ui_test_utils::FindInPage(web_contents,
Nikita (slow) 2013/05/07 17:20:25 This test may become flaky pretty soon. Imagine it
vasilii 2013/05/08 13:12:50 Done.
+ ASCIIToUTF16(kOfflineMessage),
+ true,
+ true,
+ NULL,
+ NULL));
+}
+
+// Load chrome://terms with no internet connectivity.
+// Make sure offline version is shown.
+IN_PROC_BROWSER_TEST_F(TermsOfServiceProcessBrowserTest, LoadOffline) {
+ host_resolver()->AddRule("*", "127.0.0.1");
+ ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUITermsURL));
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ // TODO(vasilii): search for kOfflineMessage when offline EULAs are ready.
+ EXPECT_NE(0, ui_test_utils::FindInPage(web_contents,
+ ASCIIToUTF16("Chrome OS Terms"),
+ true,
+ true,
+ NULL,
+ NULL));
+}
+
+} // namespace
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698