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

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

Issue 200054: Hook up WebFrameClient, replacing many WebViewDelegate methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/empty_webframeclient.h ('k') | webkit/glue/inspector_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #undef LOG 9 #undef LOG
10 10
(...skipping 17 matching lines...) Expand all
28 typedef TestShellTest IFrameRedirectTest; 28 typedef TestShellTest IFrameRedirectTest;
29 29
30 // Tests that loading a page in an iframe from javascript results in 30 // Tests that loading a page in an iframe from javascript results in
31 // a redirect from about:blank. 31 // a redirect from about:blank.
32 TEST_F(IFrameRedirectTest, Test) { 32 TEST_F(IFrameRedirectTest, Test) {
33 FilePath iframes_data_dir_ = data_dir_; 33 FilePath iframes_data_dir_ = data_dir_;
34 iframes_data_dir_ = iframes_data_dir_.AppendASCII("test_shell"); 34 iframes_data_dir_ = iframes_data_dir_.AppendASCII("test_shell");
35 iframes_data_dir_ = iframes_data_dir_.AppendASCII("iframe_redirect"); 35 iframes_data_dir_ = iframes_data_dir_.AppendASCII("iframe_redirect");
36 ASSERT_TRUE(file_util::PathExists(iframes_data_dir_)); 36 ASSERT_TRUE(file_util::PathExists(iframes_data_dir_));
37 37
38 std::wstring test_url = GetTestURL(iframes_data_dir_, "main.html"); 38 GURL test_url = GetTestURL(iframes_data_dir_, "main.html");
39 39
40 test_shell_->LoadURL(test_url.c_str()); 40 test_shell_->LoadURL(test_url);
41 test_shell_->WaitTestFinished(); 41 test_shell_->WaitTestFinished();
42 42
43 WebFrame* iframe = 43 WebFrame* iframe =
44 test_shell_->webView()->GetFrameWithName(WebString::fromUTF8("ifr")); 44 test_shell_->webView()->GetFrameWithName(WebString::fromUTF8("ifr"));
45 ASSERT_TRUE(iframe != NULL); 45 ASSERT_TRUE(iframe != NULL);
46 WebDataSource* iframe_ds = iframe->dataSource(); 46 WebDataSource* iframe_ds = iframe->dataSource();
47 ASSERT_TRUE(iframe_ds != NULL); 47 ASSERT_TRUE(iframe_ds != NULL);
48 WebVector<WebURL> redirects; 48 WebVector<WebURL> redirects;
49 iframe_ds->redirectChain(redirects); 49 iframe_ds->redirectChain(redirects);
50 ASSERT_FALSE(redirects.isEmpty()); 50 ASSERT_FALSE(redirects.isEmpty());
51 ASSERT_TRUE(GURL(redirects[0]) == GURL("about:blank")); 51 ASSERT_TRUE(GURL(redirects[0]) == GURL("about:blank"));
52 } 52 }
OLDNEW
« no previous file with comments | « webkit/glue/empty_webframeclient.h ('k') | webkit/glue/inspector_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698