blob: fff8968b2bf734e2c56c2964ed75fc9ea743a341 [file] [log] [blame]
[email protected]871dc682012-06-11 19:35:331// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]4af886ca2012-04-07 00:05:112// 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/file_path.h"
6#include "base/utf_string_conversions.h"
7#include "chrome/browser/ui/browser.h"
[email protected]52877dbc62012-06-29 22:22:038#include "chrome/browser/ui/browser_tabstrip.h"
[email protected]4af886ca2012-04-07 00:05:119#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 "googleurl/src/gurl.h"
13
14class IFrameTest : public InProcessBrowserTest {
15 protected:
16 void NavigateAndVerifyTitle(const char* file, const char* page_title) {
17 GURL url = ui_test_utils::GetTestUrl(
18 FilePath(), FilePath().AppendASCII(file));
19
20 ui_test_utils::NavigateToURL(browser(), url);
21 EXPECT_EQ(ASCIIToUTF16(page_title),
[email protected]52877dbc62012-06-29 22:22:0322 chrome::GetActiveWebContents(browser())->GetTitle());
[email protected]4af886ca2012-04-07 00:05:1123 }
24};
25
26IN_PROC_BROWSER_TEST_F(IFrameTest, Crash) {
27 NavigateAndVerifyTitle("iframe.html", "iframe test");
28}
29
30IN_PROC_BROWSER_TEST_F(IFrameTest, InEmptyFrame) {
31 NavigateAndVerifyTitle("iframe_in_empty_frame.html", "iframe test");
32}