| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 25 #include "base/test/test_file_util.h" | 25 #include "base/test/test_file_util.h" |
| 26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 27 #include "base/values.h" | 27 #include "base/values.h" |
| 28 #include "chrome/app/chrome_command_ids.h" | 28 #include "chrome/app/chrome_command_ids.h" |
| 29 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 29 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 30 #include "chrome/browser/background/background_contents_service.h" | 30 #include "chrome/browser/background/background_contents_service.h" |
| 31 #include "chrome/browser/browser_process.h" | 31 #include "chrome/browser/browser_process.h" |
| 32 #include "chrome/browser/chrome_notification_types.h" | 32 #include "chrome/browser/chrome_notification_types.h" |
| 33 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 33 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 34 #include "chrome/browser/devtools/devtools_window.h" | 34 #include "chrome/browser/devtools/devtools_window_testing.h" |
| 35 #include "chrome/browser/download/download_prefs.h" | 35 #include "chrome/browser/download/download_prefs.h" |
| 36 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" | 36 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" |
| 37 #include "chrome/browser/extensions/crx_installer.h" | 37 #include "chrome/browser/extensions/crx_installer.h" |
| 38 #include "chrome/browser/extensions/extension_service.h" | 38 #include "chrome/browser/extensions/extension_service.h" |
| 39 #include "chrome/browser/extensions/unpacked_installer.h" | 39 #include "chrome/browser/extensions/unpacked_installer.h" |
| 40 #include "chrome/browser/extensions/updater/extension_cache_fake.h" | 40 #include "chrome/browser/extensions/updater/extension_cache_fake.h" |
| 41 #include "chrome/browser/extensions/updater/extension_updater.h" | 41 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 42 #include "chrome/browser/infobars/infobar_service.h" | 42 #include "chrome/browser/infobars/infobar_service.h" |
| 43 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 43 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 44 #include "chrome/browser/media/media_stream_devices_controller.h" | 44 #include "chrome/browser/media/media_stream_devices_controller.h" |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 // Disable devtools via policy. | 1404 // Disable devtools via policy. |
| 1405 PolicyMap policies; | 1405 PolicyMap policies; |
| 1406 policies.Set(key::kDeveloperToolsDisabled, | 1406 policies.Set(key::kDeveloperToolsDisabled, |
| 1407 POLICY_LEVEL_MANDATORY, | 1407 POLICY_LEVEL_MANDATORY, |
| 1408 POLICY_SCOPE_USER, | 1408 POLICY_SCOPE_USER, |
| 1409 new base::FundamentalValue(true), | 1409 new base::FundamentalValue(true), |
| 1410 NULL); | 1410 NULL); |
| 1411 content::WindowedNotificationObserver close_observer( | 1411 content::WindowedNotificationObserver close_observer( |
| 1412 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 1412 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 1413 content::Source<content::WebContents>( | 1413 content::Source<content::WebContents>( |
| 1414 devtools_window->web_contents_for_test())); | 1414 DevToolsWindowTesting::Get(devtools_window)->main_web_contents())); |
| 1415 UpdateProviderPolicy(policies); | 1415 UpdateProviderPolicy(policies); |
| 1416 // wait for devtools close | 1416 // wait for devtools close |
| 1417 close_observer.Wait(); | 1417 close_observer.Wait(); |
| 1418 // The existing devtools window should have closed. | 1418 // The existing devtools window should have closed. |
| 1419 EXPECT_FALSE(DevToolsWindow::GetInstanceForInspectedWebContents(contents)); | 1419 EXPECT_FALSE(DevToolsWindow::GetInstanceForInspectedWebContents(contents)); |
| 1420 // And it's not possible to open it again. | 1420 // And it's not possible to open it again. |
| 1421 EXPECT_FALSE(chrome::ExecuteCommand(browser(), IDC_DEV_TOOLS)); | 1421 EXPECT_FALSE(chrome::ExecuteCommand(browser(), IDC_DEV_TOOLS)); |
| 1422 EXPECT_FALSE(DevToolsWindow::GetInstanceForInspectedWebContents(contents)); | 1422 EXPECT_FALSE(DevToolsWindow::GetInstanceForInspectedWebContents(contents)); |
| 1423 } | 1423 } |
| 1424 | 1424 |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3131 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3131 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
| 3132 browser2->tab_strip_model()->GetActiveWebContents(), | 3132 browser2->tab_strip_model()->GetActiveWebContents(), |
| 3133 "domAutomationController.send(window.showModalDialog !== undefined);", | 3133 "domAutomationController.send(window.showModalDialog !== undefined);", |
| 3134 &result)); | 3134 &result)); |
| 3135 EXPECT_TRUE(result); | 3135 EXPECT_TRUE(result); |
| 3136 } | 3136 } |
| 3137 | 3137 |
| 3138 #endif // !defined(CHROME_OS) | 3138 #endif // !defined(CHROME_OS) |
| 3139 | 3139 |
| 3140 } // namespace policy | 3140 } // namespace policy |
| OLD | NEW |