Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: chrome/test/gpu/gpu_pixel_browsertest.cc

Issue 11753009: Simplify ExecuteJavaScript* functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update prerender_browsertest.cc. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/ui_test_utils.cc ('k') | content/browser/bookmarklet_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); 176 ASSERT_TRUE(message_queue.WaitForMessage(NULL));
177 message_queue.ClearQueue(); 177 message_queue.ClearQueue();
178 178
179 gfx::Rect new_bounds = GetNewTabContainerBounds(tab_container_size); 179 gfx::Rect new_bounds = GetNewTabContainerBounds(tab_container_size);
180 180
181 std::ostringstream js_call; 181 std::ostringstream js_call;
182 js_call << "preCallResizeInChromium("; 182 js_call << "preCallResizeInChromium(";
183 js_call << new_bounds.width() << ", " << new_bounds.height(); 183 js_call << new_bounds.width() << ", " << new_bounds.height();
184 js_call << ");"; 184 js_call << ");";
185 185
186 ASSERT_TRUE(content::ExecuteJavaScript( 186 ASSERT_TRUE(content::ExecuteScript(
187 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), 187 chrome::GetActiveWebContents(browser()), js_call.str()));
188 "",
189 js_call.str()));
190 188
191 std::string message; 189 std::string message;
192 ASSERT_TRUE(message_queue.WaitForMessage(&message)); 190 ASSERT_TRUE(message_queue.WaitForMessage(&message));
193 message_queue.ClearQueue(); 191 message_queue.ClearQueue();
194 browser()->window()->SetBounds(new_bounds); 192 browser()->window()->SetBounds(new_bounds);
195 193
196 // Wait for message from test page indicating the rendering is done. 194 // Wait for message from test page indicating the rendering is done.
197 while (message.compare("\"resized\"")) { 195 while (message.compare("\"resized\"")) {
198 ASSERT_TRUE(message_queue.WaitForMessage(&message)); 196 ASSERT_TRUE(message_queue.WaitForMessage(&message));
199 message_queue.ClearQueue(); 197 message_queue.ClearQueue();
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 {160, 100, 0, 0, 0} 590 {160, 100, 0, 0, 0}
593 }; 591 };
594 const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel); 592 const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel);
595 593
596 gfx::Size container_size(400, 300); 594 gfx::Size container_size(400, 300);
597 FilePath url = 595 FilePath url =
598 test_data_dir().AppendASCII("pixel_canvas2d.html"); 596 test_data_dir().AppendASCII("pixel_canvas2d.html");
599 RunPixelTest(container_size, url, ref_img_revision_update, 597 RunPixelTest(container_size, url, ref_img_revision_update,
600 ref_pixels, ref_pixel_count); 598 ref_pixels, ref_pixel_count);
601 } 599 }
OLDNEW
« no previous file with comments | « chrome/test/base/ui_test_utils.cc ('k') | content/browser/bookmarklet_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698