| 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 6487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6498 EXPECT_TRUE(client.didNotify()); | 6498 EXPECT_TRUE(client.didNotify()); |
| 6499 EXPECT_EQ(0xff0000ff, frame->document().themeColor()); | 6499 EXPECT_EQ(0xff0000ff, frame->document().themeColor()); |
| 6500 // Change of second theme-color meta tag will not change frame's theme | 6500 // Change of second theme-color meta tag will not change frame's theme |
| 6501 // color. | 6501 // color. |
| 6502 client.reset(); | 6502 client.reset(); |
| 6503 frame->executeScript(WebScriptSource("document.getElementById('tc2').setAttr
ibute('content', '#00FF00');")); | 6503 frame->executeScript(WebScriptSource("document.getElementById('tc2').setAttr
ibute('content', '#00FF00');")); |
| 6504 EXPECT_TRUE(client.didNotify()); | 6504 EXPECT_TRUE(client.didNotify()); |
| 6505 EXPECT_EQ(0xff0000ff, frame->document().themeColor()); | 6505 EXPECT_EQ(0xff0000ff, frame->document().themeColor()); |
| 6506 } | 6506 } |
| 6507 | 6507 |
| 6508 // Make sure that an embedder-triggered detach with a remote frame parent |
| 6509 // doesn't leave behind dangling pointers. |
| 6510 TEST_F(WebFrameTest, EmbedderTriggeredDetachWithRemoteMainFrame) |
| 6511 { |
| 6512 // FIXME: Refactor some of this logic into WebViewHelper to make it easier t
o |
| 6513 // write tests with a top-level remote frame. |
| 6514 FrameTestHelpers::TestWebViewClient viewClient; |
| 6515 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; |
| 6516 WebView* view = WebView::create(&viewClient); |
| 6517 view->setMainFrame(WebRemoteFrame::create(&remoteClient)); |
| 6518 FrameTestHelpers::TestWebFrameClient childFrameClient; |
| 6519 WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLoc
alChild("", &childFrameClient); |
| 6520 |
| 6521 // Purposely keep the LocalFrame alive so it's the last thing to be destroye
d. |
| 6522 RefPtr<Frame> childCoreFrame = toCoreFrame(childFrame); |
| 6523 view->close(); |
| 6524 childCoreFrame.clear(); |
| 6525 } |
| 6526 |
| 6508 class WebFrameSwapTest : public WebFrameTest { | 6527 class WebFrameSwapTest : public WebFrameTest { |
| 6509 protected: | 6528 protected: |
| 6510 WebFrameSwapTest() | 6529 WebFrameSwapTest() |
| 6511 { | 6530 { |
| 6512 registerMockedHttpURLLoad("frame-a-b-c.html"); | 6531 registerMockedHttpURLLoad("frame-a-b-c.html"); |
| 6513 registerMockedHttpURLLoad("subframe-a.html"); | 6532 registerMockedHttpURLLoad("subframe-a.html"); |
| 6514 registerMockedHttpURLLoad("subframe-b.html"); | 6533 registerMockedHttpURLLoad("subframe-b.html"); |
| 6515 registerMockedHttpURLLoad("subframe-c.html"); | 6534 registerMockedHttpURLLoad("subframe-c.html"); |
| 6516 registerMockedHttpURLLoad("subframe-hello.html"); | 6535 registerMockedHttpURLLoad("subframe-hello.html"); |
| 6517 | 6536 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6782 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6801 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6783 | 6802 |
| 6784 // Neither should a page reload. | 6803 // Neither should a page reload. |
| 6785 localFrame->reload(); | 6804 localFrame->reload(); |
| 6786 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6805 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
| 6787 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6806 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
| 6788 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6807 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6789 } | 6808 } |
| 6790 | 6809 |
| 6791 } // namespace | 6810 } // namespace |
| OLD | NEW |