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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_unittest.cc

Issue 9558007: Ensure that SequencedWorkerPools in tests don't outlive their tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failures Created 8 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
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/message_loop.h"
5 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/autocomplete/autocomplete_edit.h" 7 #include "chrome/browser/autocomplete/autocomplete_edit.h"
7 #include "chrome/browser/ui/omnibox/omnibox_view.h" 8 #include "chrome/browser/ui/omnibox/omnibox_view.h"
8 #include "chrome/test/base/testing_browser_process.h" 9 #include "chrome/test/base/testing_browser_process.h"
9 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/skia/include/core/SkBitmap.h" 12 #include "third_party/skia/include/core/SkBitmap.h"
12 13
13 using content::WebContents; 14 using content::WebContents;
14 15
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 virtual TabContentsWrapper* GetTabContentsWrapper() const OVERRIDE { 101 virtual TabContentsWrapper* GetTabContentsWrapper() const OVERRIDE {
101 return NULL; 102 return NULL;
102 } 103 }
103 104
104 private: 105 private:
105 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditController); 106 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditController);
106 }; 107 };
107 108
108 } // namespace 109 } // namespace
109 110
110 typedef testing::Test AutocompleteEditTest; 111 class AutocompleteEditTest : public ::testing::Test {
112 private:
113 // Needed by the blocking pool (but no need to pump it).
114 MessageLoop message_loop_;
115 };
111 116
112 // Tests various permutations of AutocompleteModel::AdjustTextForCopy. 117 // Tests various permutations of AutocompleteModel::AdjustTextForCopy.
113 TEST(AutocompleteEditTest, AdjustTextForCopy) { 118 TEST_F(AutocompleteEditTest, AdjustTextForCopy) {
114 struct Data { 119 struct Data {
115 const char* perm_text; 120 const char* perm_text;
116 const int sel_start; 121 const int sel_start;
117 const bool is_all_selected; 122 const bool is_all_selected;
118 const char* input; 123 const char* input;
119 const char* expected_output; 124 const char* expected_output;
120 const bool write_url; 125 const bool write_url;
121 const char* expected_url; 126 const char* expected_url;
122 } input[] = { 127 } input[] = {
123 // Test that http:// is inserted if all text is selected. 128 // Test that http:// is inserted if all text is selected.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 GURL url; 173 GURL url;
169 bool write_url; 174 bool write_url;
170 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected, 175 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected,
171 &result, &url, &write_url); 176 &result, &url, &write_url);
172 EXPECT_EQ(ASCIIToUTF16(input[i].expected_output), result) << "@: " << i; 177 EXPECT_EQ(ASCIIToUTF16(input[i].expected_output), result) << "@: " << i;
173 EXPECT_EQ(input[i].write_url, write_url) << " @" << i; 178 EXPECT_EQ(input[i].write_url, write_url) << " @" << i;
174 if (write_url) 179 if (write_url)
175 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i; 180 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i;
176 } 181 }
177 } 182 }
OLDNEW
« no previous file with comments | « base/threading/sequenced_worker_pool_unittest.cc ('k') | content/browser/trace_subscriber_stdio_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698