| 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 <stdint.h> | 6 #include <stdint.h> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 TestExtensionDir tls_channel_id_connectable_dir_; | 515 TestExtensionDir tls_channel_id_connectable_dir_; |
| 516 TestExtensionDir hosted_app_dir_; | 516 TestExtensionDir hosted_app_dir_; |
| 517 }; | 517 }; |
| 518 | 518 |
| 519 IN_PROC_BROWSER_TEST_F(ExternallyConnectableMessagingTest, NotInstalled) { | 519 IN_PROC_BROWSER_TEST_F(ExternallyConnectableMessagingTest, NotInstalled) { |
| 520 InitializeTestServer(); | 520 InitializeTestServer(); |
| 521 | 521 |
| 522 scoped_refptr<const Extension> extension = | 522 scoped_refptr<const Extension> extension = |
| 523 ExtensionBuilder() | 523 ExtensionBuilder() |
| 524 .SetID("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") | 524 .SetID("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") |
| 525 .SetManifest(std::move(DictionaryBuilder() | 525 .SetManifest(DictionaryBuilder() |
| 526 .Set("name", "Fake extension") | 526 .Set("name", "Fake extension") |
| 527 .Set("version", "1") | 527 .Set("version", "1") |
| 528 .Set("manifest_version", 2))) | 528 .Set("manifest_version", 2) |
| 529 .Build()) |
| 529 .Build(); | 530 .Build(); |
| 530 | 531 |
| 531 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); | 532 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); |
| 532 EXPECT_EQ(NAMESPACE_NOT_DEFINED, | 533 EXPECT_EQ(NAMESPACE_NOT_DEFINED, |
| 533 CanConnectAndSendMessagesToMainFrame(extension.get())); | 534 CanConnectAndSendMessagesToMainFrame(extension.get())); |
| 534 EXPECT_FALSE(AreAnyNonWebApisDefinedForMainFrame()); | 535 EXPECT_FALSE(AreAnyNonWebApisDefinedForMainFrame()); |
| 535 | 536 |
| 536 ui_test_utils::NavigateToURL(browser(), google_com_url()); | 537 ui_test_utils::NavigateToURL(browser(), google_com_url()); |
| 537 EXPECT_EQ(NAMESPACE_NOT_DEFINED, | 538 EXPECT_EQ(NAMESPACE_NOT_DEFINED, |
| 538 CanConnectAndSendMessagesToMainFrame(extension.get())); | 539 CanConnectAndSendMessagesToMainFrame(extension.get())); |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 | 1232 |
| 1232 // The presence of the chromium hosted app triggers this bug. The chromium | 1233 // The presence of the chromium hosted app triggers this bug. The chromium |
| 1233 // connectable extension needs to be installed to set up the runtime bindings. | 1234 // connectable extension needs to be installed to set up the runtime bindings. |
| 1234 LoadChromiumHostedApp(); | 1235 LoadChromiumHostedApp(); |
| 1235 LoadChromiumConnectableExtension(); | 1236 LoadChromiumConnectableExtension(); |
| 1236 | 1237 |
| 1237 scoped_refptr<const Extension> invalid = | 1238 scoped_refptr<const Extension> invalid = |
| 1238 ExtensionBuilder() | 1239 ExtensionBuilder() |
| 1239 // A bit scary that this works... | 1240 // A bit scary that this works... |
| 1240 .SetID("invalid") | 1241 .SetID("invalid") |
| 1241 .SetManifest(std::move(DictionaryBuilder() | 1242 .SetManifest(DictionaryBuilder() |
| 1242 .Set("name", "Fake extension") | 1243 .Set("name", "Fake extension") |
| 1243 .Set("version", "1") | 1244 .Set("version", "1") |
| 1244 .Set("manifest_version", 2))) | 1245 .Set("manifest_version", 2) |
| 1246 .Build()) |
| 1245 .Build(); | 1247 .Build(); |
| 1246 | 1248 |
| 1247 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); | 1249 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); |
| 1248 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, | 1250 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, |
| 1249 CanConnectAndSendMessagesToMainFrame(invalid.get())); | 1251 CanConnectAndSendMessagesToMainFrame(invalid.get())); |
| 1250 } | 1252 } |
| 1251 | 1253 |
| 1252 #endif // !defined(OS_WIN) - http://crbug.com/350517. | 1254 #endif // !defined(OS_WIN) - http://crbug.com/350517. |
| 1253 | 1255 |
| 1254 } // namespace | 1256 } // namespace |
| 1255 | 1257 |
| 1256 }; // namespace extensions | 1258 }; // namespace extensions |
| OLD | NEW |