| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 : FakeWebPlugin(frame, params) | 78 : FakeWebPlugin(frame, params) |
| 79 { | 79 { |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual bool hasSelection() const { return true; } | 82 virtual bool hasSelection() const { return true; } |
| 83 virtual WebString selectionAsText() const { return WebString("x"); } | 83 virtual WebString selectionAsText() const { return WebString("x"); } |
| 84 virtual WebString selectionAsMarkup() const { return WebString("y"); } | 84 virtual WebString selectionAsMarkup() const { return WebString("y"); } |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 class TestPluginWebFrameClient : public FrameTestHelpers::TestWebFrameClient { | 87 class TestPluginWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
| 88 virtual WebPlugin* createPlugin(WebLocalFrame* frame, const WebPluginParams&
params) OVERRIDE | 88 virtual WebPlugin* createPlugin(WebLocalFrame* frame, const WebPluginParams&
params) override |
| 89 { | 89 { |
| 90 if (params.mimeType == WebString::fromUTF8("application/x-webkit-test-we
bplugin")) | 90 if (params.mimeType == WebString::fromUTF8("application/x-webkit-test-we
bplugin")) |
| 91 return new TestPlugin(frame, params); | 91 return new TestPlugin(frame, params); |
| 92 return WebFrameClient::createPlugin(frame, params); | 92 return WebFrameClient::createPlugin(frame, params); |
| 93 } | 93 } |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 WebPluginContainer* getWebPluginContainer(WebView* webView, const WebString& id) | 96 WebPluginContainer* getWebPluginContainer(WebView* webView, const WebString& id) |
| 97 { | 97 { |
| 98 WebElement element = webView->mainFrame()->document().getElementById(id); | 98 WebElement element = webView->mainFrame()->document().getElementById(id); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 webView->resize(WebSize(300, 300)); | 170 webView->resize(WebSize(300, 300)); |
| 171 webView->layout(); | 171 webView->layout(); |
| 172 FrameTestHelpers::runPendingTasks(); | 172 FrameTestHelpers::runPendingTasks(); |
| 173 | 173 |
| 174 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE
lementById(WebString::fromUTF8("translated-plugin")); | 174 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE
lementById(WebString::fromUTF8("translated-plugin")); |
| 175 EXPECT_TRUE(webView->mainFrame()->executeCommand("Copy", pluginContainerOne
Element)); | 175 EXPECT_TRUE(webView->mainFrame()->executeCommand("Copy", pluginContainerOne
Element)); |
| 176 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We
bClipboard::Buffer())); | 176 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We
bClipboard::Buffer())); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } | 179 } |
| OLD | NEW |