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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/tabs/tab_strip_model.h"
8 #include "chrome/common/url_constants.h"
9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h"
11 #include "net/dns/mock_host_resolver.h"
12
13 namespace {
14
15 const char kOfflineMessage[] = "The terms posted online may be updated"
16 " from time to time";
17
18 class TermsOfServiceProcessBrowserTest : public InProcessBrowserTest {
19 };
20
21 // Load chrome://terms. Make sure online version is shown.
22 IN_PROC_BROWSER_TEST_F(TermsOfServiceProcessBrowserTest, LoadOnline) {
23 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUITermsURL));
24 content::WebContents* web_contents =
25 browser()->tab_strip_model()->GetActiveWebContents();
26 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.
27 ASCIIToUTF16(kOfflineMessage),
28 true,
29 true,
30 NULL,
31 NULL));
32 }
33
34 // Load chrome://terms with no internet connectivity.
35 // Make sure offline version is shown.
36 IN_PROC_BROWSER_TEST_F(TermsOfServiceProcessBrowserTest, LoadOffline) {
37 host_resolver()->AddRule("*", "127.0.0.1");
38 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUITermsURL));
39 content::WebContents* web_contents =
40 browser()->tab_strip_model()->GetActiveWebContents();
41 // TODO(vasilii): search for kOfflineMessage when offline EULAs are ready.
42 EXPECT_NE(0, ui_test_utils::FindInPage(web_contents,
43 ASCIIToUTF16("Chrome OS Terms"),
44 true,
45 true,
46 NULL,
47 NULL));
48 }
49
50 } // namespace
OLDNEW
« 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