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 4844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4855 frame->moveCaretSelection(WebPoint(0, 0)); | 4855 frame->moveCaretSelection(WebPoint(0, 0)); |
4856 } | 4856 } |
4857 | 4857 |
4858 TEST_F(WebFrameTest, NavigateToSandboxedMarkup) | 4858 TEST_F(WebFrameTest, NavigateToSandboxedMarkup) |
4859 { | 4859 { |
4860 FrameTestHelpers::TestWebFrameClient webFrameClient; | 4860 FrameTestHelpers::TestWebFrameClient webFrameClient; |
4861 FrameTestHelpers::WebViewHelper webViewHelper; | 4861 FrameTestHelpers::WebViewHelper webViewHelper; |
4862 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad("about:blank", tr
ue, &webFrameClient); | 4862 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad("about:blank", tr
ue, &webFrameClient); |
4863 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); | 4863 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); |
4864 | 4864 |
4865 frame->document().setIsTransitionDocument(); | 4865 frame->document().setIsTransitionDocument(true); |
4866 | 4866 |
4867 std::string markup("<div id='foo'></div><script>document.getElementById('foo
').setAttribute('dir', 'rtl')</script>"); | 4867 std::string markup("<div id='foo'></div><script>document.getElementById('foo
').setAttribute('dir', 'rtl')</script>"); |
4868 frame->navigateToSandboxedMarkup(WebData(markup.data(), markup.length())); | 4868 frame->navigateToSandboxedMarkup(WebData(markup.data(), markup.length())); |
4869 | 4869 |
4870 webFrameClient.waitForLoadToComplete(); | 4870 webFrameClient.waitForLoadToComplete(); |
4871 | 4871 |
4872 WebDocument document = webViewImpl->mainFrame()->document(); | 4872 WebDocument document = webViewImpl->mainFrame()->document(); |
4873 WebElement transitionElement = document.getElementById("foo"); | 4873 WebElement transitionElement = document.getElementById("foo"); |
4874 // Check that the markup got navigated to successfully. | 4874 // Check that the markup got navigated to successfully. |
4875 EXPECT_FALSE(transitionElement.isNull()); | 4875 EXPECT_FALSE(transitionElement.isNull()); |
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6924 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6924 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6925 | 6925 |
6926 // Neither should a page reload. | 6926 // Neither should a page reload. |
6927 localFrame->reload(); | 6927 localFrame->reload(); |
6928 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6928 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6929 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6929 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6930 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6930 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6931 } | 6931 } |
6932 | 6932 |
6933 } // namespace | 6933 } // namespace |
OLD | NEW |