| OLD | NEW |
| 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/test/base/chrome_render_view_host_test_harness.h" | 7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 8 #include "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "content/public/browser/notification_details.h" | 10 #include "content/public/browser/notification_details.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 WebAuthFlow::Delegate* delegate, | 38 WebAuthFlow::Delegate* delegate, |
| 39 Profile* profile, | 39 Profile* profile, |
| 40 const std::string& extension_id, | 40 const std::string& extension_id, |
| 41 const GURL& provider_url, | 41 const GURL& provider_url, |
| 42 bool interactive) | 42 bool interactive) |
| 43 : WebAuthFlow( | 43 : WebAuthFlow( |
| 44 delegate, | 44 delegate, |
| 45 profile, | 45 profile, |
| 46 extension_id, | 46 extension_id, |
| 47 provider_url, | 47 provider_url, |
| 48 interactive ? WebAuthFlow::INTERACTIVE : WebAuthFlow::SILENT), | 48 interactive ? WebAuthFlow::INTERACTIVE : WebAuthFlow::SILENT, |
| 49 gfx::Rect()), |
| 49 profile_(profile), | 50 profile_(profile), |
| 50 web_contents_(NULL), | 51 web_contents_(NULL), |
| 51 window_shown_(false) { } | 52 window_shown_(false) { } |
| 52 | 53 |
| 53 virtual WebContents* CreateWebContents() OVERRIDE { | 54 virtual WebContents* CreateWebContents() OVERRIDE { |
| 54 CHECK(!web_contents_); | 55 CHECK(!web_contents_); |
| 55 web_contents_ = WebContentsTester::CreateTestWebContents(profile_, NULL); | 56 web_contents_ = WebContentsTester::CreateTestWebContents(profile_, NULL); |
| 56 return web_contents_; | 57 return web_contents_; |
| 57 } | 58 } |
| 58 | 59 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // http scheme is not allowed. | 223 // http scheme is not allowed. |
| 223 EXPECT_FALSE(CallIsValidRedirectUrl( | 224 EXPECT_FALSE(CallIsValidRedirectUrl( |
| 224 GURL("http://abcdefghij.chromiumapp.org/callback"))); | 225 GURL("http://abcdefghij.chromiumapp.org/callback"))); |
| 225 EXPECT_FALSE(CallIsValidRedirectUrl( | 226 EXPECT_FALSE(CallIsValidRedirectUrl( |
| 226 GURL("https://abcd.chromiumapp.org/callback"))); | 227 GURL("https://abcd.chromiumapp.org/callback"))); |
| 227 EXPECT_FALSE(CallIsValidRedirectUrl( | 228 EXPECT_FALSE(CallIsValidRedirectUrl( |
| 228 GURL("chrome-extension://abcd/callback"))); | 229 GURL("chrome-extension://abcd/callback"))); |
| 229 EXPECT_FALSE(CallIsValidRedirectUrl( | 230 EXPECT_FALSE(CallIsValidRedirectUrl( |
| 230 GURL("chrome-extension://abcdefghijkl/"))); | 231 GURL("chrome-extension://abcdefghijkl/"))); |
| 231 } | 232 } |
| OLD | NEW |