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

Side by Side Diff: chrome/browser/extensions/extension_view_unittest.cc

Issue 39163: Make JavaScript alerts reflect the URL of the frame they came from, not the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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/browser/extensions/extension_view.cc ('k') | chrome/browser/js_before_unload_handler.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "chrome/browser/browser.h" 6 #include "chrome/browser/browser.h"
7 #include "chrome/browser/renderer_host/render_view_host.h" 7 #include "chrome/browser/renderer_host/render_view_host.h"
8 #include "chrome/browser/profile.h" 8 #include "chrome/browser/profile.h"
9 #include "chrome/browser/extensions/extension_error_reporter.h" 9 #include "chrome/browser/extensions/extension_error_reporter.h"
10 #include "chrome/browser/extensions/extension_view.h" 10 #include "chrome/browser/extensions/extension_view.h"
(...skipping 25 matching lines...) Expand all
36 MessageLoop::current()->PostDelayedTask(FROM_HERE, 36 MessageLoop::current()->PostDelayedTask(FROM_HERE,
37 new MessageLoop::QuitTask, kAlertTimeoutMs); 37 new MessageLoop::QuitTask, kAlertTimeoutMs);
38 ui_test_utils::RunMessageLoop(); 38 ui_test_utils::RunMessageLoop();
39 } 39 }
40 40
41 bool got_message() { return got_message_; } 41 bool got_message() { return got_message_; }
42 private: 42 private:
43 virtual void RunJavaScriptMessage( 43 virtual void RunJavaScriptMessage(
44 const std::wstring& message, 44 const std::wstring& message,
45 const std::wstring& default_prompt, 45 const std::wstring& default_prompt,
46 const GURL& frame_url,
46 const int flags, 47 const int flags,
47 IPC::Message* reply_msg, 48 IPC::Message* reply_msg,
48 bool* did_suppress_message) { 49 bool* did_suppress_message) {
49 got_message_ = true; 50 got_message_ = true;
50 MessageLoopForUI::current()->Quit(); 51 MessageLoopForUI::current()->Quit();
51 } 52 }
52 53
53 bool got_message_; 54 bool got_message_;
54 }; 55 };
55 56
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 124
124 // Now wait for it to load, and grab a pointer to it. 125 // Now wait for it to load, and grab a pointer to it.
125 Extension* extension = observer.WaitForExtension(); 126 Extension* extension = observer.WaitForExtension();
126 ASSERT_TRUE(extension); 127 ASSERT_TRUE(extension);
127 GURL url = Extension::GetResourceURL(extension->url(), "index.html"); 128 GURL url = Extension::GetResourceURL(extension->url(), "index.html");
128 129
129 // Start the extension process and wait for it to show a javascript alert. 130 // Start the extension process and wait for it to show a javascript alert.
130 MockExtensionView view(url, profile); 131 MockExtensionView view(url, profile);
131 EXPECT_TRUE(view.got_message()); 132 EXPECT_TRUE(view.got_message());
132 } 133 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_view.cc ('k') | chrome/browser/js_before_unload_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698