summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Switch to WebFrame from the WebKit API.darin@chromium.org2009-08-101-12/+12
| | | | | | | | | | | | | | | I tried to avoid unnecessary changes in this CL to help make it easier to review. As part of this CL, glue/webtextinput* are folded into WebFrame / WebFrameImpl. R=dglazkov BUG=10034 TEST=none Review URL: http://codereview.chromium.org/164225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22896 0039d316-1c4b-4281-b951-d872f2087c98
* Print only the focused frame. This makes more sense than trying to print ↵sverrir@chromium.org2009-07-161-8/+42
| | | | | | | | | | | | | | all frames since most of the time you end up with ugly clipping and scroll bars on the printed page. This also fixes printing issue with print selection since we don't pick up the currently selected text if's not in the main frame. Also did some refactoring of the printing test in render_view_unittest. Mainly to reuse the new Image class. BUG=http://crbug.com/15250 TEST=Print pages with frames. Print selection when using multiple frames (one example in bug). Review URL: http://codereview.chromium.org/149644 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20876 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 20855.darin@chromium.org2009-07-161-7/+23
| | | | | | Review URL: http://codereview.chromium.org/149744 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20859 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 20854.darin@chromium.org2009-07-161-23/+7
| | | | | | Review URL: http://codereview.chromium.org/155621 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20855 0039d316-1c4b-4281-b951-d872f2087c98
* Use WebWidget from the WebKit API. This change also makesdarin@chromium.org2009-07-161-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use of WebKitClient (replacing WebWidgetDelegate from glue). The ripple effects of this change are rather large, but most of the impact is mechanical. The more interesting changes include: 1- Removing the WebWidget parameter from WebWidgetClient methods. This didn't matter at all to RenderWidget or RenderView, but it did cause some changes to be made to TestWebViewDelegate. Now, it is not possible to share a delegate implementation for both the WebView and a popup menu, so I have a second instance of the delegate owned by TestShell for use with popup menus. 2- Plumbing WebNavigationPolicy in place of WindowOpenDisposition was getting to be a pretty large change, so I stopped short of deleting WindowOpenDisposition. That way the Chrome side can remain mostly unmodified. I then added a mapping function to convert from WebNavigationPolicy to WindowOpenDisposition. 3- The IME methods on WebWidget were renamed (reviewed separately by hbono), and there is now an enum to specify the composition command (WebCompositionCommand). 4- I added IPC serialization for WebCompositionCommand and WebTextDirection, which cleaned up some code that was just using ints in IPC messages. R=jam BUG=16234 TEST=none Review URL: http://codereview.chromium.org/149620 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20854 0039d316-1c4b-4281-b951-d872f2087c98
* Fix: Off-by-one errors in loops over key codes in render_view_unittest.ccyuzo@chromium.org2009-07-021-2/+2
| | | | | | | | | BUG=none TEST=n/a Review URL: http://codereview.chromium.org/151194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19804 0039d316-1c4b-4281-b951-d872f2087c98
* Don't disable view-source mode on cancellation. On error, we should turn offbrettw@chromium.org2009-06-251-0/+35
| | | | | | | | | | | | | | | view-source mode not to show error page in view-source mode. However, on cancellation, it's not necessary and sometimes render non-error page with view-source: prefix in non view-source mode by mistake. In fixing this, I pushed down SetInViewSourceMode to RenderView from WebFrameImpl. We can control view-source state more precisely by this way. Patch by tyoshino@google.com Original review: http://codereview.chromium.org/122026 BUG=4516 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19205 0039d316-1c4b-4281-b951-d872f2087c98
* Add a test to print using javascript. This is to make sure I don't break ↵sverrir@google.com2009-06-051-0/+31
| | | | | | | | | | | anything when I start to do the async printing. BUG=none TEST=run unit tests Review URL: http://codereview.chromium.org/119245 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17747 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a one pixel offset error in PrintLayoutTest. Now checks with a 5% ↵sverrir@google.com2009-06-051-2/+8
| | | | | | | | | | | margin. We need to figure out why this is different between machines and runs. BUG=none TEST=none Review URL: http://codereview.chromium.org/118312 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17746 0039d316-1c4b-4281-b951-d872f2087c98
* Reenable unittest and fix the failure. This failed after a change in thesverrir@google.com2009-06-051-4/+1
| | | | | | | | | | | page sizing. BUG=none TEST=none Review URL: http://codereview.chromium.org/118271 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17731 0039d316-1c4b-4281-b951-d872f2087c98
* Disable failing PrintLayoutTest test. Commenting out because of local ↵sverrir@google.com2009-06-041-0/+3
| | | | | | | | | | | | compilation issues BUG=none TEST=none Review URL: http://codereview.chromium.org/118261 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17664 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a RenderViewTest.PrintLayoutTest.hbono@chromium.org2009-05-231-0/+88
| | | | | | | | | | | | | | This change adds a new test 'RenderViewTest.PrintLayoutTest', which prints an HTML page and verify its output. To process a print job and verify its output, this change adds a pseudo-printer device "MockPrinter" into the MockRenderThread object. This MockPrinter object receives print-related IPC messages, process print jobs, and store the MD5 checksum of the output data. The current RenderViewTest.PrintLayoutTest retrieves the MD5 checksum values and just compare them with expected values. Nevertheless, please feel free to give me your ideas to improve this test. Finally, this change is inspired by PrintingLayoutTextTests (created by maruel) and a RenderViewTest.OnPrintPages (created by Mohamed Mansour). I would like to express my best gratitude to them. BUG=none TEST=none Review URL: http://codereview.chromium.org/100255 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16834 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent an extra copy of data types that get passed into IPC messages whenmpcomplete@google.com2009-05-201-1/+1
| | | | | | | | | | sending them. This makes it so that types sendable via IPC no longer need copy constructors. BUG=12296 Review URL: http://codereview.chromium.org/112042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16497 0039d316-1c4b-4281-b951-d872f2087c98
* Implements keyboard events for RenderViewTest.This change implements a ↵hbono@chromium.org2009-05-111-87/+252
| | | | | | | | function RenderViewTest::SendKeyEvent() that sends a keyboard event to a RenderView object.To emulate not only US keyboards but also non-US keyboards, this change adds a new class "MockKeyboard", which implements a mapping function from a triple <keyboard type, key code, modifiers> to a Unicode character so that engineers can write RenderViewTest cases without taking care of keyboard types.As samples for this new function, I updated my test RenderViewTest.OnHandleKeyboardEvent and added another test RenderViewTest.InsertCharacters.I wish this class help engineers write more RenderViewTest cases. Review URL: http://codereview.chromium.org/92122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15748 0039d316-1c4b-4281-b951-d872f2087c98
* Change chrome-ui to chrome. I didn't go too far in converting existing ↵glen@chromium.org2009-05-061-1/+1
| | | | | | | | | | | | | | strings to using the url_constant (shipshipship). Users (such as those on Beta and Dev using session restore) attempting to load the old pages will see a blank white screen. BUG=11272 TEST=Verify that the inspector, debugger, history, downloads and newtab pages load with chrome:// URLS. Verify that replacing the chrome:// with chrome-ui:// does not work. Review URL: http://codereview.chromium.org/101026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15378 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a keyboard-event test into RenderViewTest.hbono@chromium.org2009-04-231-0/+180
| | | | | | | | | | | | | | This change adds a new test "RenderViewTest.OnHandleKeyboardEvent" to verify we can receive proper DOM events when we send platform-specific keyboard events. This test is mainly for verifying our WebKit-glue code can convert platform-specific keyboard events to keyboard events of WebKit without any problems, which is hard to implement with LayoutTests. To emulate non-US layouts, this test loads the following keyboard-layout drivers: * Arabic (qwerty); * United States (qwerty); * French (azerty); * Hebrew, and; * Canadian French (qwerty). Review URL: http://codereview.chromium.org/75034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14287 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce printing test case (Step 1)hbono@chromium.org2009-04-161-1/+34
| | | | | | | | | | | | | | | | | | This CL will just show how to actually execute a full print process from start to finish. It will verify that a page has been printed (successfully). In the next steps, we would need to test whether the elements rendered after printing are correct. (how?) And fixed some lint errors. Thanks for hbono and maruel to lead me in the right direction :) Original patch by Mohamed Mansour (see http://codereview.chromium.org/67036/show), r=me,maruel,sverrir. BUG=? Review URL: http://codereview.chromium.org/67202 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13831 0039d316-1c4b-4281-b951-d872f2087c98
* Add JsonSchema-based validation for the tab APIs.aa@chromium.org2009-04-141-186/+1
| | | | | | | | | Arv: can you take json_schema.js and json_schema_test.js. Matt: you take the rest. Review URL: http://codereview.chromium.org/66006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13720 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add JsonSchema-based validation for the tab APIs."aa@chromium.org2009-04-141-1/+186
| | | | | | | | | | | This reverts commit 4f47758f5238f2e5b05d9de18f390bfe2aeb6980. Revert "TBR: Fix unit tests, line endings." This reverts commit 257fa01e20c46c68dce1c5992b75c64686cb1a66. Review URL: http://codereview.chromium.org/67122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13652 0039d316-1c4b-4281-b951-d872f2087c98
* Add JsonSchema-based validation for the tab APIs.aa@chromium.org2009-04-141-186/+1
| | | | | | | | | Arv: can you take json_schema.js and json_schema_test.js. Matt: you take the rest. Review URL: http://codereview.chromium.org/66006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13649 0039d316-1c4b-4281-b951-d872f2087c98
* Hook up extension events to the json parser, and change the extension messagempcomplete@google.com2009-04-131-12/+15
| | | | | | | | | | passing stuff to use json. Also made sure to lowercase extension IDs when looking them up in ExtensionMessageService. Review URL: http://codereview.chromium.org/67054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13612 0039d316-1c4b-4281-b951-d872f2087c98
* rebase and more minor changes.aa@chromium.org2009-04-091-5/+4
| | | | | | Review URL: http://codereview.chromium.org/62182 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13410 0039d316-1c4b-4281-b951-d872f2087c98
* Add aa's Event class to our javascript bindings and use it in our extensionmpcomplete@google.com2009-04-081-5/+7
| | | | | | | message passing API. Review URL: http://codereview.chromium.org/62069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13371 0039d316-1c4b-4281-b951-d872f2087c98
* Add code to support 2-way communication between extensions and renderers. ↵mpcomplete@google.com2009-04-021-0/+90
| | | | | | | | The code is almost fully symmetrical, except that right now a channel can only be opened to an extension (by ID). It should be trivial to open a channel to a tab, once we have a solid tab API. Review URL: http://codereview.chromium.org/56037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13057 0039d316-1c4b-4281-b951-d872f2087c98
* Use WebScriptSource and WebFindInPageRequest from the WebKit API.darin@chromium.org2009-03-311-2/+5
| | | | | | | | | | | | | | | | | | This change introduces some helper functions in glue_util.cc for efficient conversion between WebString and WebCore::String when inside the implementation of webkit/glue. This is a temporary change since eventually all code in glue that uses WebCore will be moved into the WebKit API implementation. Instead of making the Chrome automation use WebFindInPageRequest, I decided to introduce AutomationMsg_Find_Params as a copy of the old FindInPageRequest structure. That preserves the IPC protocol and avoids making the automation library depend on WebKit. R=dglazkov Review URL: http://codereview.chromium.org/57060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12881 0039d316-1c4b-4281-b951-d872f2087c98
* A tricky fix for Issue 1845 (Take 2).hbono@chromium.org2009-03-251-0/+48
| | | | | | | | | | This is almost the same change as <http://codereview.chromium.org/39252/show>, which caused a build break on a Linux buildbot while compiling my new template function in "chrome/common/render_messages.h". Even though I was not able to reproduce the build errors on my Linux box, I removed this function and use the int type in my IPC message 'ViewMsg_SetTextDirection'. BUG=1845 Review URL: http://codereview.chromium.org/42495 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12434 0039d316-1c4b-4281-b951-d872f2087c98
* Chrome-side of moving webkit/glue/cache_manager.{h,cc} to the WebKit API layer.darin@chromium.org2009-03-191-2/+1
| | | | | | | | | | | | | | This also includes a change to not have third_party/WebKit/WebKit/chromium/public in the global include path. Most of the code changes pertain to this. I also took this opportunity to do some renaming: browser/cache_manager_host -> browser/renderer_host/web_cache_manager R=brettw Review URL: http://codereview.chromium.org/42194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12085 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 11953.hbono@chromium.org2009-03-181-48/+0
| | | | | | Review URL: http://codereview.chromium.org/48121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11954 0039d316-1c4b-4281-b951-d872f2087c98
* A tricky fix for Issue 1845.hbono@chromium.org2009-03-181-0/+48
| | | | | | | | | | | | | | | | | This change is a very tricky fix for Issue 1845 in chromium: cant alignt text to the right using right shift and right ctrl.This change consists of two parts listed below. 1. Emulating the implementation of Safari that changes the text-direction of an input element. Safari uses context menus to change the text direction. This change adds an IPC message 'ViewMsg_SetTextDirection', which notifies the new text direction. Also, it adds two functions: RenderWidgetHost::UpdateTextDirection() and RenderWidgetHost::NotifyTextDirection(). They encapsulate the new IPC message so that we can use them both when we presses a set of keys and when we add context-menu items which change the text direction. 2. Calling the above interface when pressing right-shift and right-control keys, or when left-shift and left-control keys. This modifies the RenderWidgetHostViewWin::OnKeyEvent() function and call the above text-direction interfaces when a user finishes pressing the keys. As you can imagine, if we send an IPC message every time when we receive a WM_KEYDOWN event, we continue sending IPC messages while a user is pressing the keys. BUG=1845 Review URL: http://codereview.chromium.org/39252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11953 0039d316-1c4b-4281-b951-d872f2087c98
* Commit 40144. I had to move to to a separate CL to use gcl'saa@chromium.org2009-03-131-3/+2
| | | | | | | | "try multiple commits" feature. Review URL: http://codereview.chromium.org/46062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11683 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in chrome/. All files end in a single newline. Review URL: http://codereview.chromium.org/42015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11331 0039d316-1c4b-4281-b951-d872f2087c98
* Make our IME backend platform-independent.hbono@chromium.org2009-03-031-0/+128
| | | | | | | This change makes our IME backend run not only on Windows but also on Linux and Mac. This change also adds another unit-test which verifies the backend runs on Linux and Mac without problems. Review URL: http://codereview.chromium.org/27124 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10783 0039d316-1c4b-4281-b951-d872f2087c98
* Chrome side to pick up new WebKit API changes.darin@chromium.org2009-02-281-0/+8
| | | | | | | | | | | | | | | | | | | | | WebKit API now provides: - layoutTestMode - support for registering extra local URL schemes - access to the current WebKitClient WebKitClient was extended to include: - access to the default locale - access to the current time - methods to start/stop the shared timer - method to get work scheduled on the main thread - methods to access cookies - method to prefetch hostnames R=dglazkov Review URL: http://codereview.chromium.org/27276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10665 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor code from RenderThread and PluginThread and move it to ChildThread. ↵jam@chromium.org2009-02-211-6/+4
| | | | | | | | | | | ChildProcess now owns the ChildThread, which removes duplicate code and simplifies things. Clean up ChildProcess, there really was no need for all the templates and statics in it and its subclasses. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=10080 Review URL: http://codereview.chromium.org/21502 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10144 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 10080.jam@chromium.org2009-02-201-3/+6
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10082 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor code from RenderThread and PluginThread and move it to ChildThread. ↵jam@chromium.org2009-02-201-6/+3
| | | | | | | | | ChildProcess now owns the ChildThread, which removes duplicate code and simplifies things. Clean up ChildProcess, there really was no need for all the templates and statics in it and its subclasses. Review URL: http://codereview.chromium.org/21502 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10080 0039d316-1c4b-4281-b951-d872f2087c98
* Add the first unit-test that tests our IME backend.hbono@chromium.org2009-02-121-0/+55
| | | | | | | | | This change is the first unit-test that tests our IME backend in the RenderWidget class. Thanks to the unit-test framework for the RenderView class created by Carlos and Brett, we can now implement this unit test. (I'm not sure I use this framework correctly, though. Please blame me if I use it improperly.) Currently, this IME test just tests if our IME code can properly activate (or de-activate) IMEs for an <input> element and the initial position of a candidate window. I'm going to add more practical cases to this test. Review URL: http://codereview.chromium.org/20014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9648 0039d316-1c4b-4281-b951-d872f2087c98
* Finish taking out render_messages.h includes from headers.jam@chromium.org2009-02-051-0/+1
| | | | | | Review URL: http://codereview.chromium.org/20072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9209 0039d316-1c4b-4281-b951-d872f2087c98
* Change chrome:// to chrome-ui://, fix up one chrome-resource:// reference.glen@chromium.org2009-01-291-1/+1
| | | | | | Review URL: http://codereview.chromium.org/18175 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8896 0039d316-1c4b-4281-b951-d872f2087c98
* render_* work.jrg@chromium.org2009-01-271-2/+3
| | | | | | Review URL: http://codereview.chromium.org/18650 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8732 0039d316-1c4b-4281-b951-d872f2087c98
* Factor out the message sink from MockRenderThread to a separate class. I will bebrettw@chromium.org2009-01-171-6/+6
| | | | | | | using this in a RenderView test in the future. Review URL: http://codereview.chromium.org/18326 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8255 0039d316-1c4b-4281-b951-d872f2087c98
* First pass as implementing the greasemonkey API. This patchaa@chromium.org2009-01-171-1/+3
| | | | | | | | | | | | | | | | | | | includes a javascript file with stubbed versions of all the greasemoney API methods as well as changes to the Greasemonkey slave to inject this javascript file along with other user scripts into the page.I also have a userscript I'm using for the unit testing of the API methods. I don't think there is a good place for it in the chrome tree (if there is I'd like to know), but you can view it here: http://skrul.com/greasemonkey/test.user.js Right now all the tests fail except for testLog and testUnsafeWindow. Review URL: http://codereview.chromium.org/18183 Patch from Steve Krulewitz <skrulx@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8247 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor the render widget unittest so it can be reused to create a render viewbrettw@chromium.org2009-01-051-0/+128
unit test. Change the mock render thread to save all IPC messages it is asked to send so that tests can verify that the correct ones were sent. There are some new functions that support this checking. Plumb the form state change notification through the render view so that we will correctly update the form state to the browser. Write two RenderView unit tests. One arbitrarily tests OnLoadAlternateHTMLText which I used as a testcase for my testing framework. The other tests the above form state change notification. I had to expose the timeout of this message through the RenderView API so that the test can change it. Review URL: http://codereview.chromium.org/16482 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7549 0039d316-1c4b-4281-b951-d872f2087c98