| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 469 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 470 shell()->LoadURL(custom_embedded_test_server->GetURL("/index.html")); | 470 shell()->LoadURL(custom_embedded_test_server->GetURL("/index.html")); |
| 471 navigation_observer.Wait(); | 471 navigation_observer.Wait(); |
| 472 | 472 |
| 473 GetManifestAndWait(); | 473 GetManifestAndWait(); |
| 474 EXPECT_FALSE(manifest().IsEmpty()); | 474 EXPECT_FALSE(manifest().IsEmpty()); |
| 475 EXPECT_EQ(0u, console_error_count()); | 475 EXPECT_EQ(0u, console_error_count()); |
| 476 | 476 |
| 477 // The custom embedded test server will fill the name field with the cookie | 477 // The custom embedded test server will fill the name field with the cookie |
| 478 // content. | 478 // content. |
| 479 EXPECT_TRUE(EqualsASCII(manifest().name.string(), "foobar")); | 479 EXPECT_TRUE(base::EqualsASCII(manifest().name.string(), "foobar")); |
| 480 } | 480 } |
| 481 | 481 |
| 482 namespace { | 482 namespace { |
| 483 | 483 |
| 484 scoped_ptr<net::test_server::HttpResponse> CustomHandleRequestForNoCookies( | 484 scoped_ptr<net::test_server::HttpResponse> CustomHandleRequestForNoCookies( |
| 485 const net::test_server::HttpRequest& request) { | 485 const net::test_server::HttpRequest& request) { |
| 486 if (request.relative_url == "/index.html") { | 486 if (request.relative_url == "/index.html") { |
| 487 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 487 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
| 488 new net::test_server::BasicHttpResponse()); | 488 new net::test_server::BasicHttpResponse()); |
| 489 http_response->set_code(net::HTTP_OK); | 489 http_response->set_code(net::HTTP_OK); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 525 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 526 shell()->LoadURL(custom_embedded_test_server->GetURL("/index.html")); | 526 shell()->LoadURL(custom_embedded_test_server->GetURL("/index.html")); |
| 527 navigation_observer.Wait(); | 527 navigation_observer.Wait(); |
| 528 | 528 |
| 529 GetManifestAndWait(); | 529 GetManifestAndWait(); |
| 530 EXPECT_FALSE(manifest().IsEmpty()); | 530 EXPECT_FALSE(manifest().IsEmpty()); |
| 531 EXPECT_EQ(0u, console_error_count()); | 531 EXPECT_EQ(0u, console_error_count()); |
| 532 | 532 |
| 533 // The custom embedded test server will fill set the name to 'no cookies' if | 533 // The custom embedded test server will fill set the name to 'no cookies' if |
| 534 // it did not find cookies. | 534 // it did not find cookies. |
| 535 EXPECT_TRUE(EqualsASCII(manifest().name.string(), "no cookies")); | 535 EXPECT_TRUE(base::EqualsASCII(manifest().name.string(), "no cookies")); |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace content | 538 } // namespace content |
| OLD | NEW |