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

Side by Side Diff: webkit/glue/iframe_redirect_unittest.cc

Issue 10536207: Remove layoutTestController from test_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: really fix mac Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 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 "base/file_util.h"
8 #include "base/string_util.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
15 #include "webkit/glue/webkit_glue.h"
16 #include "webkit/tools/test_shell/test_shell_test.h"
17
18 using WebKit::WebDataSource;
19 using WebKit::WebFrame;
20 using WebKit::WebString;
21 using WebKit::WebURL;
22 using WebKit::WebVector;
23
24 typedef TestShellTest IFrameRedirectTest;
25
26 // Tests that loading a page in an iframe from javascript results in
27 // a redirect from about:blank.
28 TEST_F(IFrameRedirectTest, Test) {
29 FilePath iframes_data_dir_ = data_dir_;
30 iframes_data_dir_ = iframes_data_dir_.AppendASCII("test_shell");
31 iframes_data_dir_ = iframes_data_dir_.AppendASCII("iframe_redirect");
32 ASSERT_TRUE(file_util::PathExists(iframes_data_dir_));
33
34 GURL test_url = GetTestURL(iframes_data_dir_, "main.html");
35
36 test_shell_->LoadURL(test_url);
37 test_shell_->WaitTestFinished();
38
39 WebFrame* iframe =
40 test_shell_->webView()->findFrameByName(WebString::fromUTF8("ifr"));
41 ASSERT_TRUE(iframe != NULL);
42 WebDataSource* iframe_ds = iframe->dataSource();
43 ASSERT_TRUE(iframe_ds != NULL);
44 WebVector<WebURL> redirects;
45 iframe_ds->redirectChain(redirects);
46 ASSERT_FALSE(redirects.isEmpty());
47 ASSERT_TRUE(GURL(redirects[0]) == GURL("about:blank"));
48 }
OLDNEW
« no previous file with comments | « webkit/data/test_shell/iframe_redirect/main.html ('k') | webkit/tools/test_shell/layout_test_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698