Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / iframe_browsertest.cc
blobe0853f61b98991ffd32c7f5303cfadb94269debe
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.
5 #include "base/files/file_path.h"
6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h"
11 #include "content/public/browser/web_contents.h"
12 #include "url/gurl.h"
14 class IFrameTest : public InProcessBrowserTest {
15 protected:
16 void NavigateAndVerifyTitle(const char* file, const char* page_title) {
17 GURL url = ui_test_utils::GetTestUrl(
18 base::FilePath(), base::FilePath().AppendASCII(file));
20 ui_test_utils::NavigateToURL(browser(), url);
21 EXPECT_EQ(base::ASCIIToUTF16(page_title),
22 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle());
26 IN_PROC_BROWSER_TEST_F(IFrameTest, Crash) {
27 NavigateAndVerifyTitle("iframe.html", "iframe test");
30 IN_PROC_BROWSER_TEST_F(IFrameTest, InEmptyFrame) {
31 NavigateAndVerifyTitle("iframe_in_empty_frame.html", "iframe test");