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

Side by Side Diff: chrome/browser/extensions/api/identity/web_auth_flow_unittest.cc

Issue 10413039: Valgrind: Fix a leak. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « no previous file | no next file » | 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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" 6 #include "chrome/browser/extensions/api/identity/web_auth_flow.h"
7 #include "chrome/browser/ui/extensions/web_auth_flow_window.h" 7 #include "chrome/browser/ui/extensions/web_auth_flow_window.h"
8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
9 #include "chrome/test/base/testing_profile.h" 9 #include "chrome/test/base/testing_profile.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 class WebAuthFlowTest : public ChromeRenderViewHostTestHarness { 98 class WebAuthFlowTest : public ChromeRenderViewHostTestHarness {
99 protected: 99 protected:
100 WebAuthFlowTest() 100 WebAuthFlowTest()
101 : thread_(BrowserThread::UI, &message_loop_) { 101 : thread_(BrowserThread::UI, &message_loop_) {
102 } 102 }
103 103
104 virtual void SetUp() { 104 virtual void SetUp() {
105 ChromeRenderViewHostTestHarness::SetUp(); 105 ChromeRenderViewHostTestHarness::SetUp();
106 } 106 }
107 107
108 virtual void TearDown() {
109 // |flow_| must be reset before ChromeRenderViewHostTestHarness::TearDown(),
110 // because |flow_| deletes the WebContents it owns via
111 // MessageLoop::DeleteSoon().
112 flow_.reset();
113 ChromeRenderViewHostTestHarness::TearDown();
114 }
115
108 void CreateAuthFlow(const std::string& extension_id, const GURL& url) { 116 void CreateAuthFlow(const std::string& extension_id, const GURL& url) {
109 flow_.reset(new MockWebAuthFlow(&delegate_, profile(), extension_id, url)); 117 flow_.reset(new MockWebAuthFlow(&delegate_, profile(), extension_id, url));
110 } 118 }
111 119
112 MockWebAuthFlow& flow() { 120 MockWebAuthFlow& flow() {
113 return *flow_.get(); 121 return *flow_.get();
114 } 122 }
115 123
116 WebAuthFlow* flow_base() { 124 WebAuthFlow* flow_base() {
117 return flow_.get(); 125 return flow_.get();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // http scheme is not allowed. 208 // http scheme is not allowed.
201 EXPECT_FALSE(CallIsValidRedirectUrl( 209 EXPECT_FALSE(CallIsValidRedirectUrl(
202 GURL("http://abcdefghij.chromiumapp.org/callback"))); 210 GURL("http://abcdefghij.chromiumapp.org/callback")));
203 EXPECT_FALSE(CallIsValidRedirectUrl( 211 EXPECT_FALSE(CallIsValidRedirectUrl(
204 GURL("https://abcd.chromiumapp.org/callback"))); 212 GURL("https://abcd.chromiumapp.org/callback")));
205 EXPECT_FALSE(CallIsValidRedirectUrl( 213 EXPECT_FALSE(CallIsValidRedirectUrl(
206 GURL("chrome-extension://abcd/callback"))); 214 GURL("chrome-extension://abcd/callback")));
207 EXPECT_FALSE(CallIsValidRedirectUrl( 215 EXPECT_FALSE(CallIsValidRedirectUrl(
208 GURL("chrome-extension://abcdefghijkl/"))); 216 GURL("chrome-extension://abcdefghijkl/")));
209 } 217 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698