| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/page/ContextMenuController.h" | 6 #include "core/page/ContextMenuController.h" |
| 7 | 7 |
| 8 #include "core/clipboard/DataTransfer.h" | 8 #include "core/clipboard/DataTransfer.h" |
| 9 #include "core/events/MouseEvent.h" | 9 #include "core/events/MouseEvent.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 virtual void SetUp() | 22 virtual void SetUp() |
| 23 { | 23 { |
| 24 m_pageHolder = DummyPageHolder::create(IntSize(800, 600)); | 24 m_pageHolder = DummyPageHolder::create(IntSize(800, 600)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 Document& document() const { return m_pageHolder->document(); } | 27 Document& document() const { return m_pageHolder->document(); } |
| 28 | 28 |
| 29 void setBodyInnerHTML(const String& htmlContent) | 29 void setBodyInnerHTML(const String& htmlContent) |
| 30 { | 30 { |
| 31 document().body()->setInnerHTML(htmlContent, ASSERT_NO_EXCEPTION); | 31 document().body()->setInnerHTML(htmlContent, ASSERT_NO_EXCEPTION); |
| 32 document().view()->updateAllLifecyclePhases(); | 32 document().view()->updateLayoutAndStyleForPainting(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 OwnPtr<DummyPageHolder> m_pageHolder; | 36 OwnPtr<DummyPageHolder> m_pageHolder; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 TEST_F(ContextMenuControllerTest, TestCustomMenu) | 39 TEST_F(ContextMenuControllerTest, TestCustomMenu) |
| 40 { | 40 { |
| 41 document().settings()->setScriptEnabled(true); | 41 document().settings()->setScriptEnabled(true); |
| 42 // Load the the test page. | 42 // Load the the test page. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 EXPECT_STREQ("Title 7 checked", document().title().utf8().data()); | 102 EXPECT_STREQ("Title 7 checked", document().title().utf8().data()); |
| 103 document().page()->contextMenuController().contextMenuItemSelected(&items[4]
); | 103 document().page()->contextMenuController().contextMenuItemSelected(&items[4]
); |
| 104 EXPECT_STREQ("Title 7 not checked", document().title().utf8().data()); | 104 EXPECT_STREQ("Title 7 not checked", document().title().utf8().data()); |
| 105 document().page()->contextMenuController().contextMenuItemSelected(&items[5]
); | 105 document().page()->contextMenuController().contextMenuItemSelected(&items[5]
); |
| 106 EXPECT_STREQ("Title 8 not checked and Title 9 checked", document().title().u
tf8().data()); | 106 EXPECT_STREQ("Title 8 not checked and Title 9 checked", document().title().u
tf8().data()); |
| 107 document().page()->contextMenuController().contextMenuItemSelected(&items[7]
); | 107 document().page()->contextMenuController().contextMenuItemSelected(&items[7]
); |
| 108 EXPECT_STREQ("Title 10 not checked and Title 8 checked", document().title().
utf8().data()); | 108 EXPECT_STREQ("Title 10 not checked and Title 8 checked", document().title().
utf8().data()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } | 111 } |
| OLD | NEW |