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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <utility> |
6 | 7 |
7 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 11 #include "chrome/browser/extensions/extension_apitest.h" |
11 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_commands.h" | 13 #include "chrome/browser/ui/browser_commands.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
15 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } else { | 92 } else { |
92 return nullptr; | 93 return nullptr; |
93 } | 94 } |
94 } | 95 } |
95 | 96 |
96 if (expectations_satisfied) { | 97 if (expectations_satisfied) { |
97 for (size_t i = 0; i < cookies_to_set.size(); i++) | 98 for (size_t i = 0; i < cookies_to_set.size(); i++) |
98 http_response->AddCustomHeader("Set-Cookie", cookies_to_set[i]); | 99 http_response->AddCustomHeader("Set-Cookie", cookies_to_set[i]); |
99 } | 100 } |
100 | 101 |
101 return http_response.Pass(); | 102 return std::move(http_response); |
102 } | 103 } |
103 | 104 |
104 class IsolatedAppTest : public ExtensionBrowserTest { | 105 class IsolatedAppTest : public ExtensionBrowserTest { |
105 public: | 106 public: |
106 // Returns whether the given tab's current URL has the given cookie. | 107 // Returns whether the given tab's current URL has the given cookie. |
107 bool WARN_UNUSED_RESULT HasCookie(WebContents* contents, | 108 bool WARN_UNUSED_RESULT HasCookie(WebContents* contents, |
108 const std::string& cookie) { | 109 const std::string& cookie) { |
109 int value_size; | 110 int value_size; |
110 std::string actual_cookie; | 111 std::string actual_cookie; |
111 ui_test_utils::GetCookies(contents->GetURL(), contents, &value_size, | 112 ui_test_utils::GetCookies(contents->GetURL(), contents, &value_size, |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 browser(), base_url.Resolve("non_app/main.html")); | 563 browser(), base_url.Resolve("non_app/main.html")); |
563 ASSERT_TRUE(ExecuteScriptAndExtractString( | 564 ASSERT_TRUE(ExecuteScriptAndExtractString( |
564 browser()->tab_strip_model()->GetWebContentsAt(0), | 565 browser()->tab_strip_model()->GetWebContentsAt(0), |
565 kRetrieveSessionStorage.c_str(), &result)); | 566 kRetrieveSessionStorage.c_str(), &result)); |
566 EXPECT_EQ("ss_normal", result); | 567 EXPECT_EQ("ss_normal", result); |
567 } | 568 } |
568 | 569 |
569 } // namespace | 570 } // namespace |
570 | 571 |
571 } // namespace extensions | 572 } // namespace extensions |
OLD | NEW |