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

Side by Side Diff: chrome/browser/chrome_content_browser_client_browsertest.cc

Issue 10941050: Second try of 157576 https://chromiumcodereview.appspot.com/10780013/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 <string>
6
7 #include "chrome/test/base/in_process_browser_test.h"
8 #include "chrome/test/base/ui_test_utils.h"
9 #include "chrome/browser/ui/browser_tabstrip.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents.h"
11 #include "content/public/browser/navigation_controller.h"
12 #include "content/public/browser/navigation_entry.h"
13 #include "content/public/browser/web_contents.h"
14 #include "googleurl/src/gurl.h"
15
16 namespace content {
17
18 class ChromeContentBrowserClientBrowserTest : public InProcessBrowserTest {
19 public:
20 // Returns the last committed navigation entry of the first tab. May be NULL
21 // if there is no such entry.
22 NavigationEntry* GetLastCommittedEntry() {
23 return chrome::GetTabContentsAt(browser(), 0)->web_contents()
24 ->GetController().GetLastCommittedEntry();
25 }
26 };
27
28 IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest,
29 UberURLHandler_SettingsPage) {
30 const GURL url_short(std::string("chrome://settings/"));
31 const GURL url_long(std::string("chrome://chrome/settings/"));
32
33 ui_test_utils::NavigateToURL(browser(), url_short);
34 NavigationEntry* entry = GetLastCommittedEntry();
35
36 ASSERT_TRUE(entry != NULL);
37 EXPECT_EQ(url_long, entry->GetURL());
38 EXPECT_EQ(url_short, entry->GetVirtualURL());
39 }
40
41 IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest,
42 UberURLHandler_ContentSettingsPage) {
43 const GURL url_short(std::string("chrome://settings/content"));
44 const GURL url_long(std::string("chrome://chrome/settings/content"));
45
46 ui_test_utils::NavigateToURL(browser(), url_short);
47 NavigationEntry* entry = GetLastCommittedEntry();
48
49 ASSERT_TRUE(entry != NULL);
50 EXPECT_EQ(url_long, entry->GetURL());
51 EXPECT_EQ(url_short, entry->GetVirtualURL());
52 }
53
54 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/extensions/lazy_background_page_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698