OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/layout_test/blink_test_controller.h" | 5 #include "content/shell/browser/layout_test/blink_test_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 #include <set> | 10 #include <set> |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 render_view_host->GetRoutingID(), stitched_layout_dump)); | 755 render_view_host->GetRoutingID(), stitched_layout_dump)); |
756 } | 756 } |
757 | 757 |
758 void BlinkTestController::OnPrintMessage(const std::string& message) { | 758 void BlinkTestController::OnPrintMessage(const std::string& message) { |
759 printer_->AddMessageRaw(message); | 759 printer_->AddMessageRaw(message); |
760 } | 760 } |
761 | 761 |
762 void BlinkTestController::OnOverridePreferences(const WebPreferences& prefs) { | 762 void BlinkTestController::OnOverridePreferences(const WebPreferences& prefs) { |
763 should_override_prefs_ = true; | 763 should_override_prefs_ = true; |
764 prefs_ = prefs; | 764 prefs_ = prefs; |
| 765 |
| 766 // Notifies the main RenderViewHost that Blink preferences changed so to avoid |
| 767 // re-usage of cached preferences that are now stale. |
| 768 RenderViewHost* main_render_view_host = |
| 769 main_window_->web_contents()->GetRenderViewHost(); |
| 770 main_render_view_host->OnWebkitPreferencesChanged(); |
765 } | 771 } |
766 | 772 |
767 void BlinkTestController::OnClearDevToolsLocalStorage() { | 773 void BlinkTestController::OnClearDevToolsLocalStorage() { |
768 ShellBrowserContext* browser_context = | 774 ShellBrowserContext* browser_context = |
769 ShellContentBrowserClient::Get()->browser_context(); | 775 ShellContentBrowserClient::Get()->browser_context(); |
770 StoragePartition* storage_partition = | 776 StoragePartition* storage_partition = |
771 BrowserContext::GetStoragePartition(browser_context, NULL); | 777 BrowserContext::GetStoragePartition(browser_context, NULL); |
772 storage_partition->GetDOMStorageContext()->DeleteLocalStorage( | 778 storage_partition->GetDOMStorageContext()->DeleteLocalStorage( |
773 content::LayoutTestDevToolsFrontend::GetDevToolsPathAsURL("", "") | 779 content::LayoutTestDevToolsFrontend::GetDevToolsPathAsURL("", "") |
774 .GetOrigin()); | 780 .GetOrigin()); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 } else { | 939 } else { |
934 printer_->AddErrorMessage(base::StringPrintf( | 940 printer_->AddErrorMessage(base::StringPrintf( |
935 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 941 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
936 event_name.c_str())); | 942 event_name.c_str())); |
937 return; | 943 return; |
938 } | 944 } |
939 bluetooth_chooser_factory_->SendEvent(event, argument); | 945 bluetooth_chooser_factory_->SendEvent(event, argument); |
940 } | 946 } |
941 | 947 |
942 } // namespace content | 948 } // namespace content |
OLD | NEW |