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 5418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5429 } | 5429 } |
5430 | 5430 |
5431 class TestAccessInitialDocumentWebFrameClient : public FrameTestHelpers::TestWeb
FrameClient { | 5431 class TestAccessInitialDocumentWebFrameClient : public FrameTestHelpers::TestWeb
FrameClient { |
5432 public: | 5432 public: |
5433 TestAccessInitialDocumentWebFrameClient() : m_didAccessInitialDocument(false
) | 5433 TestAccessInitialDocumentWebFrameClient() : m_didAccessInitialDocument(false
) |
5434 { | 5434 { |
5435 } | 5435 } |
5436 | 5436 |
5437 virtual void didAccessInitialDocument() | 5437 virtual void didAccessInitialDocument() |
5438 { | 5438 { |
5439 EXPECT_TRUE(!m_didAccessInitialDocument); | |
5440 m_didAccessInitialDocument = true; | 5439 m_didAccessInitialDocument = true; |
5441 } | 5440 } |
5442 | 5441 |
5443 bool m_didAccessInitialDocument; | 5442 bool m_didAccessInitialDocument; |
5444 }; | 5443 }; |
5445 | 5444 |
5446 TEST_P(ParameterizedWebFrameTest, DidAccessInitialDocumentBody) | 5445 TEST_P(ParameterizedWebFrameTest, DidAccessInitialDocumentBody) |
5447 { | 5446 { |
5448 // FIXME: Why is this local webViewClient needed instead of the default | 5447 // FIXME: Why is this local webViewClient needed instead of the default |
5449 // WebViewHelper one? With out it there's some mysterious crash in the | 5448 // WebViewHelper one? With out it there's some mysterious crash in the |
(...skipping 3375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8825 request.setRequestorOrigin(WebSecurityOrigin::createUnique()); | 8824 request.setRequestorOrigin(WebSecurityOrigin::createUnique()); |
8826 helper.webView()->mainFrameImpl()->loadRequest(request); | 8825 helper.webView()->mainFrameImpl()->loadRequest(request); |
8827 | 8826 |
8828 // Normally, the result of the JS url replaces the existing contents on the | 8827 // Normally, the result of the JS url replaces the existing contents on the |
8829 // Document. However, if the JS triggers a navigation, the contents should | 8828 // Document. However, if the JS triggers a navigation, the contents should |
8830 // not be replaced. | 8829 // not be replaced. |
8831 EXPECT_EQ("", toLocalFrame(helper.webView()->page()->mainFrame())->document(
)->documentElement()->innerText()); | 8830 EXPECT_EQ("", toLocalFrame(helper.webView()->page()->mainFrame())->document(
)->documentElement()->innerText()); |
8832 } | 8831 } |
8833 | 8832 |
8834 } // namespace blink | 8833 } // namespace blink |
OLD | NEW |