summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 07:35:37 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 07:35:37 +0000
commit79457797443d45463b92abcda0124706bdf1aff5 (patch)
tree83c22707ecc9649686be8d5bb5bd74913c4520d8 /chrome/browser/autocomplete/autocomplete_edit_unittest.cc
parentaf980796c6c9df7bd06210397ffa5dad155ebf66 (diff)
downloadchromium_src-79457797443d45463b92abcda0124706bdf1aff5.zip
chromium_src-79457797443d45463b92abcda0124706bdf1aff5.tar.gz
chromium_src-79457797443d45463b92abcda0124706bdf1aff5.tar.bz2
GTTF: Use a fresh TestingBrowserProcess for each test, part #1
This is going to be done in multiple steps, because lots of tests depend on global TestingBrowserProcess. However, the current solution is very error-prone, and may lead to state being carried from one test to another (via NotificationService), resulting in crashes. In theory the ScopedTestingBrowserProcess could be made empty for now, but re-initializing g_browser_process inside it has two benefits: 1) It verifies that changing g_browser_process actually works. 2) It protects at least a subset of tests from carrying state. BUG=61062 TEST=unit_tests, possibly more Review URL: http://codereview.chromium.org/6478005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_edit_unittest.cc')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_unittest.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_unittest.cc b/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
index 9d54555..5697cb4 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
@@ -5,6 +5,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
+#include "chrome/test/testing_browser_process.h"
#include "chrome/test/testing_profile.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -140,6 +141,7 @@ TEST(AutocompleteEditTest, AdjustTextForCopy) {
// Tests that we don't get double http if the user manually inserts http.
{ "a.b/", 0, false, "http://a.b/", "http://a.b/", true, "http://a.b/" },
};
+ ScopedTestingBrowserProcess browser_process;
TestingAutocompleteEditView view;
TestingAutocompleteEditController controller;
TestingProfile profile;