OLD | NEW |
---|---|
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 6501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6512 // FIXME: Refactor some of this logic into WebViewHelper to make it easier t o | 6512 // FIXME: Refactor some of this logic into WebViewHelper to make it easier t o |
6513 // write tests with a top-level remote frame. | 6513 // write tests with a top-level remote frame. |
6514 FrameTestHelpers::TestWebViewClient viewClient; | 6514 FrameTestHelpers::TestWebViewClient viewClient; |
6515 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; | 6515 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; |
6516 WebView* view = WebView::create(&viewClient); | 6516 WebView* view = WebView::create(&viewClient); |
6517 view->setMainFrame(WebRemoteFrame::create(&remoteClient)); | 6517 view->setMainFrame(WebRemoteFrame::create(&remoteClient)); |
6518 FrameTestHelpers::TestWebFrameClient childFrameClient; | 6518 FrameTestHelpers::TestWebFrameClient childFrameClient; |
6519 WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLoc alChild("", &childFrameClient); | 6519 WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLoc alChild("", &childFrameClient); |
6520 | 6520 |
6521 // Purposely keep the LocalFrame alive so it's the last thing to be destroye d. | 6521 // Purposely keep the LocalFrame alive so it's the last thing to be destroye d. |
6522 RefPtr<Frame> childCoreFrame = toCoreFrame(childFrame); | 6522 RefPtrWillBePersistent<Frame> childCoreFrame = toCoreFrame(childFrame); |
dcheng
2014/10/16 21:25:42
Why not RefPtrWillBeRaw? This is a stack pointer.
haraken
2014/10/16 23:19:10
In this case RefPtrWillBeRawPtr is fine, but we pr
| |
6523 view->close(); | 6523 view->close(); |
6524 childCoreFrame.clear(); | 6524 childCoreFrame.clear(); |
6525 } | 6525 } |
6526 | 6526 |
6527 class WebFrameSwapTest : public WebFrameTest { | 6527 class WebFrameSwapTest : public WebFrameTest { |
6528 protected: | 6528 protected: |
6529 WebFrameSwapTest() | 6529 WebFrameSwapTest() |
6530 { | 6530 { |
6531 registerMockedHttpURLLoad("frame-a-b-c.html"); | 6531 registerMockedHttpURLLoad("frame-a-b-c.html"); |
6532 registerMockedHttpURLLoad("subframe-a.html"); | 6532 registerMockedHttpURLLoad("subframe-a.html"); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6801 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6801 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6802 | 6802 |
6803 // Neither should a page reload. | 6803 // Neither should a page reload. |
6804 localFrame->reload(); | 6804 localFrame->reload(); |
6805 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6805 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6806 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6806 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6807 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6807 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6808 } | 6808 } |
6809 | 6809 |
6810 } // namespace | 6810 } // namespace |
OLD | NEW |