diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-10 18:32:52 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-10 18:32:52 +0000 |
commit | 13619fbbb3bef81f1373e92a45878cf776460b03 (patch) | |
tree | d543c6764103395b0cc3efa17c01a672ca40f15c /chrome/test/testing_browser_process.h | |
parent | 863e1409a83ec7b3849754c1dbf365d44505a147 (diff) | |
download | chromium_src-13619fbbb3bef81f1373e92a45878cf776460b03.zip chromium_src-13619fbbb3bef81f1373e92a45878cf776460b03.tar.gz chromium_src-13619fbbb3bef81f1373e92a45878cf776460b03.tar.bz2 |
Make sure one cannot cut or copy from a password
text-field.
And assorted unit-tests.
BUG=9425
TEST=Visit a page with basic auth (ex: http://prism.library.cornell.edu/control/authBasic/authTest/). Type some text in the password field. Select the text and try to cut/copy with CTRL-X, CTRL-V and right click menu. You should not be able to cut/copy the text.
Review URL: http://codereview.chromium.org/63053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_browser_process.h')
-rw-r--r-- | chrome/test/testing_browser_process.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/test/testing_browser_process.h b/chrome/test/testing_browser_process.h index e2fff16..a507586 100644 --- a/chrome/test/testing_browser_process.h +++ b/chrome/test/testing_browser_process.h @@ -17,6 +17,7 @@ #include "base/string_util.h" #include "base/waitable_event.h" #include "chrome/browser/browser_process.h" +#include "chrome/common/clipboard_service.h" #include "chrome/common/notification_service.h" class TestingBrowserProcess : public BrowserProcess { @@ -80,7 +81,11 @@ class TestingBrowserProcess : public BrowserProcess { } virtual ClipboardService* clipboard_service() { - return NULL; + if (!clipboard_service_.get()) { + // Note that we need a MessageLoop for the next call to work. + clipboard_service_.reset(new ClipboardService); + } + return clipboard_service_.get(); } virtual GoogleURLTracker* google_url_tracker() { @@ -132,6 +137,8 @@ class TestingBrowserProcess : public BrowserProcess { private: NotificationService notification_service_; scoped_ptr<base::WaitableEvent> shutdown_event_; + scoped_ptr<ClipboardService> clipboard_service_; + DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); }; |