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/base64.h" | 5 #include "base/base64.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 EXPECT_EQ(std::string(), | 525 EXPECT_EQ(std::string(), |
526 GetTlsChannelIdFromSendMessage(chromium_connectable->id(), false)); | 526 GetTlsChannelIdFromSendMessage(chromium_connectable->id(), false)); |
527 // If the page does ask for it, it isn't empty. | 527 // If the page does ask for it, it isn't empty. |
528 std::string tls_channel_id = | 528 std::string tls_channel_id = |
529 GetTlsChannelIdFromPortConnect(chromium_connectable->id(), true); | 529 GetTlsChannelIdFromPortConnect(chromium_connectable->id(), true); |
530 // Because the TLS channel ID has never been generated for this domain, | 530 // Because the TLS channel ID has never been generated for this domain, |
531 // no TLS channel ID is reported. | 531 // no TLS channel ID is reported. |
532 EXPECT_EQ(std::string(), tls_channel_id); | 532 EXPECT_EQ(std::string(), tls_channel_id); |
533 } | 533 } |
534 | 534 |
| 535 // Flaky on official Linux bot. http://crbug.com/315264 |
| 536 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_LINUX) |
| 537 #define MAYBE_WebConnectableWithEmptyTlsChannelIdAndClosedBackgroundPage \ |
| 538 DISABLED_WebConnectableWithEmptyTlsChannelIdAndClosedBackgroundPage |
| 539 #else |
| 540 #define MAYBE_WebConnectableWithEmptyTlsChannelIdAndClosedBackgroundPage \ |
| 541 WebConnectableWithEmptyTlsChannelIdAndClosedBackgroundPage |
| 542 #endif |
535 // Tests a web connectable extension that receives TLS channel id, but | 543 // Tests a web connectable extension that receives TLS channel id, but |
536 // immediately closes its background page upon receipt of a message. | 544 // immediately closes its background page upon receipt of a message. |
537 IN_PROC_BROWSER_TEST_F(ExternallyConnectableMessagingTest, | 545 IN_PROC_BROWSER_TEST_F(ExternallyConnectableMessagingTest, |
538 WebConnectableWithEmptyTlsChannelIdAndClosedBackgroundPage) { | 546 MAYBE_WebConnectableWithEmptyTlsChannelIdAndClosedBackgroundPage) { |
539 InitializeTestServer(); | 547 InitializeTestServer(); |
540 | 548 |
541 const Extension* chromium_connectable = | 549 const Extension* chromium_connectable = |
542 LoadChromiumConnectableExtensionWithTlsChannelId(); | 550 LoadChromiumConnectableExtensionWithTlsChannelId(); |
543 | 551 |
544 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); | 552 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); |
545 // If the page does ask for it, it isn't empty, even if the background page | 553 // If the page does ask for it, it isn't empty, even if the background page |
546 // closes upon receipt of the connect. | 554 // closes upon receipt of the connect. |
547 std::string tls_channel_id = | 555 std::string tls_channel_id = |
548 GetTlsChannelIdFromPortConnect(chromium_connectable->id(), | 556 GetTlsChannelIdFromPortConnect(chromium_connectable->id(), |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 base::StringPrintf( | 898 base::StringPrintf( |
891 "chrome.test.runWithUserGesture(function() {\n" | 899 "chrome.test.runWithUserGesture(function() {\n" |
892 " chrome.runtime.sendMessage('%s', {}, function(response) {\n" | 900 " chrome.runtime.sendMessage('%s', {}, function(response) {\n" |
893 " window.domAutomationController.send('' + response.result);\n" | 901 " window.domAutomationController.send('' + response.result);\n" |
894 " });\n" | 902 " });\n" |
895 "});", receiver->id().c_str()))); | 903 "});", receiver->id().c_str()))); |
896 } | 904 } |
897 | 905 |
898 } // namespace | 906 } // namespace |
899 }; // namespace extensions | 907 }; // namespace extensions |
OLD | NEW |