| 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 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| (...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 | 1402 |
| 1403 private: | 1403 private: |
| 1404 std::string source_; | 1404 std::string source_; |
| 1405 std::string content_; | 1405 std::string content_; |
| 1406 DISALLOW_COPY_AND_ASSIGN(MockWebUIProvider); | 1406 DISALLOW_COPY_AND_ASSIGN(MockWebUIProvider); |
| 1407 }; | 1407 }; |
| 1408 | 1408 |
| 1409 // This tests checks that window is correctly initialized when DevTools is | 1409 // This tests checks that window is correctly initialized when DevTools is |
| 1410 // opened while navigation through history with forward and back actions. | 1410 // opened while navigation through history with forward and back actions. |
| 1411 // (crbug.com/627407) | 1411 // (crbug.com/627407) |
| 1412 // Flaky on Windows. http://crbug.com/628174#c4 |
| 1413 #if defined(OS_WIN) |
| 1414 #define MAYBE_TestWindowInitializedOnNavigateBack \ |
| 1415 DISABLED_TestWindowInitializedOnNavigateBack |
| 1416 #else |
| 1417 #define MAYBE_TestWindowInitializedOnNavigateBack \ |
| 1418 TestWindowInitializedOnNavigateBack |
| 1419 #endif |
| 1412 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, | 1420 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, |
| 1413 TestWindowInitializedOnNavigateBack) { | 1421 MAYBE_TestWindowInitializedOnNavigateBack) { |
| 1414 TestChromeWebUIControllerFactory test_factory; | 1422 TestChromeWebUIControllerFactory test_factory; |
| 1415 MockWebUIProvider mock_provider("dummyurl", | 1423 MockWebUIProvider mock_provider("dummyurl", |
| 1416 "<script>\n" | 1424 "<script>\n" |
| 1417 " window.abc = 239;\n" | 1425 " window.abc = 239;\n" |
| 1418 " console.log(abc);\n" | 1426 " console.log(abc);\n" |
| 1419 "</script>"); | 1427 "</script>"); |
| 1420 test_factory.AddFactoryOverride(GURL("chrome://dummyurl").host(), | 1428 test_factory.AddFactoryOverride(GURL("chrome://dummyurl").host(), |
| 1421 &mock_provider); | 1429 &mock_provider); |
| 1422 content::WebUIControllerFactory::RegisterFactory(&test_factory); | 1430 content::WebUIControllerFactory::RegisterFactory(&test_factory); |
| 1423 | 1431 |
| 1424 ui_test_utils::NavigateToURL(browser(), GURL("chrome://dummyurl")); | 1432 ui_test_utils::NavigateToURL(browser(), GURL("chrome://dummyurl")); |
| 1425 DevToolsWindow* window = | 1433 DevToolsWindow* window = |
| 1426 DevToolsWindowTesting::OpenDevToolsWindowSync(GetInspectedTab(), true); | 1434 DevToolsWindowTesting::OpenDevToolsWindowSync(GetInspectedTab(), true); |
| 1427 chrome::DuplicateTab(browser()); | 1435 chrome::DuplicateTab(browser()); |
| 1428 chrome::SelectPreviousTab(browser()); | 1436 chrome::SelectPreviousTab(browser()); |
| 1429 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 1437 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 1430 chrome::GoBack(browser(), CURRENT_TAB); | 1438 chrome::GoBack(browser(), CURRENT_TAB); |
| 1431 RunTestFunction(window, "testWindowInitializedOnNavigateBack"); | 1439 RunTestFunction(window, "testWindowInitializedOnNavigateBack"); |
| 1432 | 1440 |
| 1433 DevToolsWindowTesting::CloseDevToolsWindowSync(window); | 1441 DevToolsWindowTesting::CloseDevToolsWindowSync(window); |
| 1434 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory); | 1442 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory); |
| 1435 } | 1443 } |
| OLD | NEW |