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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 27183013: Use [ImplementedAs=domWindow] for Document.defaultView() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | « Source/core/page/EventHandler.cpp ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 4296 matching lines...) Expand 10 before | Expand all | Expand 10 after
4307 registerMockedHttpURLLoad("fragment_middle_click.html"); 4307 registerMockedHttpURLLoad("fragment_middle_click.html");
4308 TestNavigationPolicyWebFrameClient client; 4308 TestNavigationPolicyWebFrameClient client;
4309 FrameTestHelpers::WebViewHelper webViewHelper; 4309 FrameTestHelpers::WebViewHelper webViewHelper;
4310 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue, &client); 4310 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue, &client);
4311 4311
4312 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document(); 4312 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document();
4313 WebCore::KURL destination = document->url(); 4313 WebCore::KURL destination = document->url();
4314 destination.setFragmentIdentifier("test"); 4314 destination.setFragmentIdentifier("test");
4315 4315
4316 RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTyp eNames::click, false, false, 4316 RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTyp eNames::click, false, false,
4317 document->defaultView(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false , 1, 0, 0); 4317 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 1, 0, 0);
4318 WebCore::FrameLoadRequest frameRequest(document->securityOrigin(), WebCore:: ResourceRequest(destination)); 4318 WebCore::FrameLoadRequest frameRequest(document->securityOrigin(), WebCore:: ResourceRequest(destination));
4319 frameRequest.setTriggeringEvent(event); 4319 frameRequest.setTriggeringEvent(event);
4320 webViewHelper.webViewImpl()->page()->mainFrame()->loader()->load(frameReques t); 4320 webViewHelper.webViewImpl()->page()->mainFrame()->loader()->load(frameReques t);
4321 } 4321 }
4322 4322
4323 TEST_F(WebFrameTest, BackToReload) 4323 TEST_F(WebFrameTest, BackToReload)
4324 { 4324 {
4325 registerMockedHttpURLLoad("fragment_middle_click.html"); 4325 registerMockedHttpURLLoad("fragment_middle_click.html");
4326 FrameTestHelpers::WebViewHelper webViewHelper; 4326 FrameTestHelpers::WebViewHelper webViewHelper;
4327 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue); 4327 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
4537 4537
4538 FrameTestHelpers::loadFrame(frame, 4538 FrameTestHelpers::loadFrame(frame,
4539 "javascript:window.frames[1].location.assign('" + m_baseURL + "find.html ')"); 4539 "javascript:window.frames[1].location.assign('" + m_baseURL + "find.html ')");
4540 runPendingTasks(); 4540 runPendingTasks();
4541 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(); 4541 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
4542 EXPECT_EQ(client.frame(), iframe); 4542 EXPECT_EQ(client.frame(), iframe);
4543 EXPECT_FALSE(client.replacesCurrentHistoryItem()); 4543 EXPECT_FALSE(client.replacesCurrentHistoryItem());
4544 } 4544 }
4545 4545
4546 } // namespace 4546 } // namespace
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698