diff --git a/DEPS b/DEPS index b158093..c84d1b4 100644 --- a/DEPS +++ b/DEPS
@@ -40,11 +40,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '064f8e2d709150bf9a1d22c8658f13009d03b577', + 'skia_revision': 'd5de013643789950aef09a9f081ac65c4c965900', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': 'd0f4f6fb8e1d0a53e2a95a1e3c7bf8211278a9f6', + 'v8_revision': 'bced9de71f2d96fc25867457662bf2da74dc8f7f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -52,7 +52,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '133a2ecb4db19cf2387e2d8eb3b4c6e0e5c6f144', + 'angle_revision': 'f1a2aefcd8709340d9fde572e2e516fcda928961', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -64,7 +64,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '0354ccf37f05f25b1bf64fd60bb3b48efab4d7d0', + 'pdfium_revision': 'e421327725da2fbc713b52ea0e623f67d7bcbcaa', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '76180b6b4e6de2a85a971c2df1b53162b8570b33', + 'catapult_revision': '6d2cfc95eb2f5717ce65291aec6ccf9b42281d2a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -224,7 +224,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'b045881ec0439f60b0447735e89c233bf51e9c73', # commit position 15242 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '6b569733c20a4baa8b780677e33418bf6d53e456', # commit position 15257 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'),
diff --git a/WATCHLISTS b/WATCHLISTS index 7d42e04..91e412f0 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -476,6 +476,10 @@ 'components/gcm_driver/|'\ 'google_apis/gcm/', }, + 'generic_sensor': { + 'filepath': 'device/generic_sensor/|'\ + 'third_party/WebKit/Source/modules/sensor/', + }, 'geolocation': { 'filepath': 'chrome/browser/geolocation/|'\ 'content/browser/geolocation|'\ @@ -1835,6 +1839,9 @@ 'gcm': ['johnme+watch@chromium.org', 'peter@chromium.org', 'zea+watch@chromium.org'], + 'generic_sensor': ['alexander.shalamov@intel.com', + 'mikhail.pozdnyakov@intel.com', + 'wanming.lin@intel.com'], 'geolocation': ['mlamouri+watch-geolocation@chromium.org', 'mvanouwerkerk@chromium.org'], 'gfx_geometry': ['cc-bugs@chromium.org'],
diff --git a/ash/common/system/chromeos/palette/common_palette_tool.cc b/ash/common/system/chromeos/palette/common_palette_tool.cc index c8378e3a..b9f39df0 100644 --- a/ash/common/system/chromeos/palette/common_palette_tool.cc +++ b/ash/common/system/chromeos/palette/common_palette_tool.cc
@@ -24,13 +24,6 @@ namespace ash { namespace { -// Returns the font used by any displayed labels. -const gfx::FontList& GetLabelFont() { - // TODO(tdanderson|jdufault): Use TrayPopupItemStyle instead. - return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta( - 1, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::MEDIUM); -} - void AddHistogramTimes(PaletteToolId id, base::TimeDelta duration) { if (id == PaletteToolId::LASER_POINTER) { UMA_HISTOGRAM_CUSTOM_TIMES("Ash.Shelf.Palette.InLaserPointerMode", duration, @@ -104,7 +97,6 @@ kTrayPopupPaddingHorizontal); highlight_view_->AddRightIcon(check, kMenuIconSize); highlight_view_->set_custom_height(kMenuButtonSize); - highlight_view_->text_label()->SetFontList(GetLabelFont()); if (enabled()) { highlight_view_->SetAccessiblityState(
diff --git a/ash/common/system/chromeos/palette/palette_tray.cc b/ash/common/system/chromeos/palette/palette_tray.cc index 5e5d950..036f4b6 100644 --- a/ash/common/system/chromeos/palette/palette_tray.cc +++ b/ash/common/system/chromeos/palette/palette_tray.cc
@@ -11,11 +11,13 @@ #include "ash/common/shelf/wm_shelf_util.h" #include "ash/common/system/chromeos/palette/palette_tool_manager.h" #include "ash/common/system/chromeos/palette/palette_utils.h" +#include "ash/common/system/tray/system_menu_button.h" #include "ash/common/system/tray/system_tray_controller.h" #include "ash/common/system/tray/system_tray_delegate.h" #include "ash/common/system/tray/tray_bubble_wrapper.h" #include "ash/common/system/tray/tray_constants.h" #include "ash/common/system/tray/tray_popup_header_button.h" +#include "ash/common/system/tray/tray_popup_item_style.h" #include "ash/common/wm_lookup.h" #include "ash/common/wm_root_window_controller.h" #include "ash/common/wm_shell.h" @@ -83,49 +85,59 @@ LoginStatus::KIOSK_APP; } -// Returns the font used by the title view. -const gfx::FontList& GetTitleFont() { - // TODO(tdanderson|jdufault): Use TrayPopupItemStyle instead. - return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta( - 2, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::MEDIUM); -} - class TitleView : public views::View, public views::ButtonListener { public: explicit TitleView(PaletteTray* palette_tray) : palette_tray_(palette_tray) { + // TODO(tdanderson|jdufault): Use TriView to handle the layout of the title. + // See crbug.com/614453. auto* box_layout = new views::BoxLayout( views::BoxLayout::kHorizontal, 0, kVerticalMarginAroundTitleView, kHorizontalPaddingBetweenTitleEntries); SetLayoutManager(box_layout); - views::Label* text_label = + title_label_ = new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_TITLE)); - text_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); - text_label->SetFontList(GetTitleFont()); - AddChildView(text_label); - box_layout->SetFlexForView(text_label, 1); + title_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); + AddChildView(title_label_); + box_layout->SetFlexForView(title_label_, 1); + if (MaterialDesignController::IsSystemTrayMenuMaterial()) { + help_button_ = + new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, + kSystemMenuHelpIcon, IDS_ASH_STATUS_TRAY_HELP); + settings_button_ = new SystemMenuButton( + this, TrayPopupInkDropStyle::HOST_CENTERED, kSystemMenuSettingsIcon, + IDS_ASH_STATUS_TRAY_SETTINGS); + } else { + gfx::ImageSkia help_icon = + gfx::CreateVectorIcon(kSystemMenuHelpIcon, kMenuIconColor); + gfx::ImageSkia settings_icon = + gfx::CreateVectorIcon(kSystemMenuSettingsIcon, kMenuIconColor); - gfx::ImageSkia settings_icon = - gfx::CreateVectorIcon(kSystemMenuSettingsIcon, kMenuIconColor); - gfx::ImageSkia help_icon = - gfx::CreateVectorIcon(kSystemMenuHelpIcon, kMenuIconColor); + auto* help_button = new ash::TrayPopupHeaderButton( + this, help_icon, IDS_ASH_STATUS_TRAY_HELP); + help_button->SetTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_HELP)); + help_button_ = help_button; - help_button_ = new ash::TrayPopupHeaderButton(this, help_icon, - IDS_ASH_STATUS_TRAY_HELP); - help_button_->SetTooltipText( - l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_HELP)); + auto* settings_button = new ash::TrayPopupHeaderButton( + this, settings_icon, IDS_ASH_STATUS_TRAY_SETTINGS); + settings_button->SetTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SETTINGS)); + settings_button_ = settings_button; + } + AddChildView(help_button_); - - settings_button_ = new ash::TrayPopupHeaderButton( - this, settings_icon, IDS_ASH_STATUS_TRAY_SETTINGS); - settings_button_->SetTooltipText( - l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SETTINGS)); AddChildView(settings_button_); } ~TitleView() override {} private: + // views::View: + void OnNativeThemeChanged(const ui::NativeTheme* theme) override { + UpdateStyle(); + } + // views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override { if (sender == settings_button_) { @@ -143,10 +155,18 @@ } } + void UpdateStyle() { + TrayPopupItemStyle style(GetNativeTheme(), + TrayPopupItemStyle::FontStyle::TITLE); + style.SetupLabel(title_label_); + } + // Unowned pointers to button views so we can determine which button was // clicked. - ash::TrayPopupHeaderButton* settings_button_; - ash::TrayPopupHeaderButton* help_button_; + views::View* settings_button_; + views::View* help_button_; + // Needed for UpdateStyles() + views::Label* title_label_; PaletteTray* palette_tray_; DISALLOW_COPY_AND_ASSIGN(TitleView);
diff --git a/base/logging.h b/base/logging.h index 714545c..a100bb45 100644 --- a/base/logging.h +++ b/base/logging.h
@@ -527,12 +527,26 @@ // it uses the definition for operator<<, with a few special cases below. template <typename T> inline typename std::enable_if< - base::internal::SupportsOstreamOperator<const T&>::value, + base::internal::SupportsOstreamOperator<const T&>::value && + !std::is_function<typename std::remove_pointer<T>::type>::value, void>::type MakeCheckOpValueString(std::ostream* os, const T& v) { (*os) << v; } +// Provide an overload for functions and function pointers. Function pointers +// don't implicitly convert to void* but do implicitly convert to bool, so +// without this function pointers are always printed as 1 or 0. (MSVC isn't +// standards-conforming here and converts function pointers to regular +// pointers, so this is a no-op for MSVC.) +template <typename T> +inline typename std::enable_if< + std::is_function<typename std::remove_pointer<T>::type>::value, + void>::type +MakeCheckOpValueString(std::ostream* os, const T& v) { + (*os) << reinterpret_cast<const void*>(v); +} + // We need overloads for enums that don't support operator<<. // (i.e. scoped enums where no operator<< overload was declared). template <typename T>
diff --git a/base/logging_unittest.cc b/base/logging_unittest.cc index 8a20c54..f41cce2f 100644 --- a/base/logging_unittest.cc +++ b/base/logging_unittest.cc
@@ -217,6 +217,14 @@ #endif } +void DcheckEmptyFunction1() { + // Provide a body so that Release builds do not cause the compiler to + // optimize DcheckEmptyFunction1 and DcheckEmptyFunction2 as a single + // function, which breaks the Dcheck tests below. + LOG(INFO) << "DcheckEmptyFunction1"; +} +void DcheckEmptyFunction2() {} + TEST_F(LoggingTest, Dcheck) { #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) // Release build. @@ -258,6 +266,31 @@ EXPECT_EQ(0, log_sink_call_count); DCHECK_EQ(Animal::DOG, Animal::CAT); EXPECT_EQ(DCHECK_IS_ON() ? 1 : 0, log_sink_call_count); + + // Test DCHECK on functions and function pointers. + log_sink_call_count = 0; + struct MemberFunctions { + void MemberFunction1() { + // See the comment in DcheckEmptyFunction1(). + LOG(INFO) << "Do not merge with MemberFunction2."; + } + void MemberFunction2() {} + }; + void (MemberFunctions::*mp1)() = &MemberFunctions::MemberFunction1; + void (MemberFunctions::*mp2)() = &MemberFunctions::MemberFunction2; + void (*fp1)() = DcheckEmptyFunction1; + void (*fp2)() = DcheckEmptyFunction2; + void (*fp3)() = DcheckEmptyFunction1; + DCHECK_EQ(fp1, fp3); + EXPECT_EQ(0, log_sink_call_count); + DCHECK_EQ(mp1, &MemberFunctions::MemberFunction1); + EXPECT_EQ(0, log_sink_call_count); + DCHECK_EQ(mp2, &MemberFunctions::MemberFunction2); + EXPECT_EQ(0, log_sink_call_count); + DCHECK_EQ(fp1, fp2); + EXPECT_EQ(DCHECK_IS_ON() ? 1 : 0, log_sink_call_count); + DCHECK_EQ(mp2, &MemberFunctions::MemberFunction1); + EXPECT_EQ(DCHECK_IS_ON() ? 2 : 0, log_sink_call_count); } TEST_F(LoggingTest, DcheckReleaseBehavior) {
diff --git a/base/memory/memory_pressure_monitor.h b/base/memory/memory_pressure_monitor.h index 033379c..e48244b 100644 --- a/base/memory/memory_pressure_monitor.h +++ b/base/memory/memory_pressure_monitor.h
@@ -35,7 +35,7 @@ static void RecordMemoryPressure(MemoryPressureLevel level, int ticks); // Returns the currently observed memory pressure. - virtual MemoryPressureLevel GetCurrentPressureLevel() const = 0; + virtual MemoryPressureLevel GetCurrentPressureLevel() = 0; // Sets a notification callback. The default callback invokes // base::MemoryPressureListener::NotifyMemoryPressure.
diff --git a/base/memory/memory_pressure_monitor_chromeos.cc b/base/memory/memory_pressure_monitor_chromeos.cc index b90075d9..05fcc9e1 100644 --- a/base/memory/memory_pressure_monitor_chromeos.cc +++ b/base/memory/memory_pressure_monitor_chromeos.cc
@@ -134,7 +134,7 @@ } MemoryPressureListener::MemoryPressureLevel -MemoryPressureMonitor::GetCurrentPressureLevel() const { +MemoryPressureMonitor::GetCurrentPressureLevel() { return current_memory_pressure_level_; }
diff --git a/base/memory/memory_pressure_monitor_chromeos.h b/base/memory/memory_pressure_monitor_chromeos.h index 88dccc9..563ba85 100644 --- a/base/memory/memory_pressure_monitor_chromeos.h +++ b/base/memory/memory_pressure_monitor_chromeos.h
@@ -58,7 +58,7 @@ void ScheduleEarlyCheck(); // Get the current memory pressure level. - MemoryPressureListener::MemoryPressureLevel GetCurrentPressureLevel() const + MemoryPressureListener::MemoryPressureLevel GetCurrentPressureLevel() override; void SetDispatchCallback(const DispatchCallback& callback) override;
diff --git a/base/memory/memory_pressure_monitor_mac.cc b/base/memory/memory_pressure_monitor_mac.cc index 5ea381f..8548169 100644 --- a/base/memory/memory_pressure_monitor_mac.cc +++ b/base/memory/memory_pressure_monitor_mac.cc
@@ -18,6 +18,10 @@ DISPATCH_EXPORT const struct dispatch_source_type_s _dispatch_source_type_memorypressure; +namespace { +static const int kUMATickSize = 5; +} // namespace + namespace base { namespace mac { @@ -44,9 +48,9 @@ dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0))), dispatch_callback_( base::Bind(&MemoryPressureListener::NotifyMemoryPressure)), - last_pressure_change_(CFAbsoluteTimeGetCurrent()), + last_statistic_report_(CFAbsoluteTimeGetCurrent()), + last_pressure_level_(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE), reporting_error_(0) { - last_pressure_level_ = GetCurrentPressureLevel(); dispatch_source_set_event_handler(memory_level_event_source_, ^{ OnMemoryPressureChanged(memory_level_event_source_.get(), dispatch_callback_); @@ -59,43 +63,59 @@ } MemoryPressureListener::MemoryPressureLevel -MemoryPressureMonitor::GetCurrentPressureLevel() const { +MemoryPressureMonitor::GetCurrentPressureLevel() { int mac_memory_pressure; size_t length = sizeof(int); sysctlbyname("kern.memorystatus_vm_pressure_level", &mac_memory_pressure, &length, nullptr, 0); - return MemoryPressureLevelForMacMemoryPressure(mac_memory_pressure); + MemoryPressureListener::MemoryPressureLevel memory_pressure_level = + MemoryPressureLevelForMacMemoryPressure(mac_memory_pressure); + bool pressure_level_changed = false; + if (last_pressure_level_ != memory_pressure_level) { + pressure_level_changed = true; + } + SendStatisticsIfNecessary(pressure_level_changed); + last_pressure_level_ = memory_pressure_level; + return memory_pressure_level; } + void MemoryPressureMonitor::OnMemoryPressureChanged( dispatch_source_s* event_source, const MemoryPressureMonitor::DispatchCallback& dispatch_callback) { int mac_memory_pressure = dispatch_source_get_data(event_source); MemoryPressureListener::MemoryPressureLevel memory_pressure_level = MemoryPressureLevelForMacMemoryPressure(mac_memory_pressure); - CFTimeInterval now = CFAbsoluteTimeGetCurrent(); - CFTimeInterval since_last_change = now - last_pressure_change_; - last_pressure_change_ = now; - - double ticks_to_report; - reporting_error_ = - modf(since_last_change + reporting_error_, &ticks_to_report); - - // Sierra fails to call the handler when pressure returns to normal, - // which would skew our data. For example, if pressure went to 'warn' - // at T0, back to 'normal' at T1, then to 'critical' at T10, we would - // report 10 ticks of 'warn' instead of 1 tick of 'warn' and 9 ticks - // of 'normal'. - // This is rdar://29114314 - if (mac::IsAtMostOS10_11()) - RecordMemoryPressure(last_pressure_level_, - static_cast<int>(ticks_to_report)); - + bool pressure_level_changed = false; + if (last_pressure_level_ != memory_pressure_level) { + pressure_level_changed = true; + } + SendStatisticsIfNecessary(pressure_level_changed); last_pressure_level_ = memory_pressure_level; if (memory_pressure_level != MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE) dispatch_callback.Run(memory_pressure_level); } +void MemoryPressureMonitor::SendStatisticsIfNecessary( + bool pressure_level_changed) { + CFTimeInterval now = CFAbsoluteTimeGetCurrent(); + CFTimeInterval since_last_report = now - last_statistic_report_; + last_statistic_report_ = now; + + double accumulated_time = since_last_report + reporting_error_; + int ticks_to_report = static_cast<int>(accumulated_time / kUMATickSize); + reporting_error_ = std::fmod(accumulated_time, kUMATickSize); + + // Round up on change to ensure we capture it + if (pressure_level_changed && ticks_to_report < 1) { + ticks_to_report = 1; + reporting_error_ = 0; + } + + if (ticks_to_report >= 1) + RecordMemoryPressure(last_pressure_level_, ticks_to_report); +} + void MemoryPressureMonitor::SetDispatchCallback( const DispatchCallback& callback) { dispatch_callback_ = callback;
diff --git a/base/memory/memory_pressure_monitor_mac.h b/base/memory/memory_pressure_monitor_mac.h index 9f89b16..9118632 100644 --- a/base/memory/memory_pressure_monitor_mac.h +++ b/base/memory/memory_pressure_monitor_mac.h
@@ -27,7 +27,7 @@ ~MemoryPressureMonitor() override; // Returns the currently-observed memory pressure. - MemoryPressureLevel GetCurrentPressureLevel() const override; + MemoryPressureLevel GetCurrentPressureLevel() override; void SetDispatchCallback(const DispatchCallback& callback) override; @@ -38,12 +38,13 @@ MemoryPressureLevelForMacMemoryPressure(int mac_memory_pressure); void OnMemoryPressureChanged(dispatch_source_s* event_source, const DispatchCallback& dispatch_callback); + void SendStatisticsIfNecessary(bool pressure_level_changed); ScopedDispatchObject<dispatch_source_t> memory_level_event_source_; DispatchCallback dispatch_callback_; - CFTimeInterval last_pressure_change_; + CFTimeInterval last_statistic_report_; MemoryPressureLevel last_pressure_level_;
diff --git a/base/memory/memory_pressure_monitor_win.cc b/base/memory/memory_pressure_monitor_win.cc index cad1fcb8..3effe2c 100644 --- a/base/memory/memory_pressure_monitor_win.cc +++ b/base/memory/memory_pressure_monitor_win.cc
@@ -90,7 +90,7 @@ } MemoryPressureListener::MemoryPressureLevel -MemoryPressureMonitor::GetCurrentPressureLevel() const { +MemoryPressureMonitor::GetCurrentPressureLevel() { return current_memory_pressure_level_; }
diff --git a/base/memory/memory_pressure_monitor_win.h b/base/memory/memory_pressure_monitor_win.h index b52a2d2..a65c191 100644 --- a/base/memory/memory_pressure_monitor_win.h +++ b/base/memory/memory_pressure_monitor_win.h
@@ -62,7 +62,7 @@ void CheckMemoryPressureSoon(); // Get the current memory pressure level. This can be called from any thread. - MemoryPressureLevel GetCurrentPressureLevel() const override; + MemoryPressureLevel GetCurrentPressureLevel() override; void SetDispatchCallback(const DispatchCallback& callback) override; // Returns the moderate pressure level free memory threshold, in MB.
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc index 1f18658..59f3d32 100644 --- a/base/metrics/field_trial.cc +++ b/base/metrics/field_trial.cc
@@ -10,7 +10,6 @@ #include "base/base_switches.h" #include "base/build_time.h" #include "base/command_line.h" -#include "base/debug/alias.h" #include "base/feature_list.h" #include "base/logging.h" #include "base/pickle.h" @@ -183,48 +182,6 @@ } } -// In order to debug the crash where two field trials with the same name but -// different groups get added to the allocator, let's try to get the stack -// frame where the second duplicate gets added here as well as the trial/group -// names by going through the allocator and checking if a trial with the same -// name already exists. -void CheckAllocatorForTrial(FieldTrialList::FieldTrialAllocator* allocator, - const std::string& trial_name, - const std::string& group_name) { - FieldTrialList::FieldTrialAllocator::Iterator iter(allocator); - FieldTrial::FieldTrialRef ref; - while ((ref = iter.GetNextOfType(kFieldTrialType)) != - FieldTrialList::FieldTrialAllocator::kReferenceNull) { - const FieldTrialEntry* entry = - allocator->GetAsObject<const FieldTrialEntry>(ref, kFieldTrialType); - - StringPiece trial_name_to_check; - StringPiece group_name_to_check; - if (!entry->GetTrialAndGroupName(&trial_name_to_check, - &group_name_to_check)) { - CHECK(false); - } - - if (trial_name_to_check.as_string() == trial_name) { - constexpr size_t buf_size = 100; - - char trial_name_c_str[buf_size]; - char group_name_c_str[buf_size]; - char existing_group_name_c_str[buf_size]; - - strlcpy(trial_name_c_str, trial_name.c_str(), buf_size); - strlcpy(group_name_c_str, group_name.c_str(), buf_size); - strlcpy(existing_group_name_c_str, - group_name_to_check.as_string().c_str(), buf_size); - - debug::Alias(trial_name_c_str); - debug::Alias(group_name_c_str); - debug::Alias(existing_group_name_c_str); - CHECK_EQ(group_name_to_check.as_string(), group_name); - } - } -} - #if defined(OS_WIN) HANDLE CreateReadOnlyHandle(FieldTrialList::FieldTrialAllocator* allocator) { HANDLE src = allocator->shared_memory()->handle().GetHandle(); @@ -931,40 +888,6 @@ FieldTrial* trial = CreateFieldTrial(trial_name.as_string(), group_name.as_string()); - // If we failed to create the field trial, crash with debug info. - // TODO(665129): Remove this when the crash is resolved. - if (!trial) { - constexpr size_t buf_size = 100; - char trial_name_c_str[buf_size] = {0}; - char group_name_c_str[buf_size] = {0}; - char existing_group_name_c_str[buf_size] = {0}; - - // Copy the names over to the stack. - std::string trial_name_string = trial_name.as_string(); - strlcpy(trial_name_c_str, trial_name_string.c_str(), buf_size); - std::string group_name_string = group_name.as_string(); - strlcpy(group_name_c_str, group_name_string.c_str(), buf_size); - - // Alias the trial and group name. - debug::Alias(trial_name_c_str); - debug::Alias(group_name_c_str); - - // Copy and alias the existing field trial name, if there is one. - FieldTrial* existing_field_trial = - FieldTrialList::Find(trial_name_string); - if (existing_field_trial) { - std::string existing_group_name_string = - existing_field_trial->group_name_internal(); - strlcpy(existing_group_name_c_str, group_name_string.c_str(), buf_size); - debug::Alias(existing_group_name_c_str); - } - CHECK(!trial_name_string.empty()); - CHECK(!group_name_string.empty()); - CHECK_EQ(existing_field_trial->group_name_internal(), - group_name.as_string()); - return false; - } - trial->ref_ = ref; if (entry->activated) { // Call |group()| to mark the trial as "used" and notify observers, if @@ -1021,10 +944,6 @@ if (allocator->IsReadonly()) return; - // TODO(665129): Remove this code once the bug has been fixed. - CheckAllocatorForTrial(allocator, field_trial->trial_name(), - field_trial->group_name_internal()); - FieldTrial::State trial_state; if (!field_trial->GetStateWhileLocked(&trial_state)) return;
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 4f0db299..66131c0 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -1068,8 +1068,8 @@ # The compiler driver can sometimes (rarely) emit warnings before calling # the actual linker. Make sure these warnings are treated as errors as # well. - # TODO(thakis): Enable this in use_custom_libcxx (asan) builds. - # TODO(thakis): Enable this in chromecast builds. + # TODO(thakis): Enable in use_custom_libcxx builds, crbug.com/669072 + # TODO(thakis): Enable in chromecast builds, crbug.com/669076 if (!use_custom_libcxx && !is_chromecast) { ldflags = [ "-Werror" ] } @@ -1130,8 +1130,8 @@ if (treat_warnings_as_errors && is_clang) { cflags += [ "-Werror" ] - # TODO(thakis): Enable this in use_custom_libcxx (asan) builds. - # TODO(thakis): Enable this in chromecast builds. + # TODO(thakis): Enable in use_custom_libcxx builds, crbug.com/669072 + # TODO(thakis): Enable in chromecast builds, crbug.com/669076 if (!use_custom_libcxx && !is_chromecast) { ldflags = [ "-Werror" ] }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java index 182ab94..0ca2026 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
@@ -633,7 +633,7 @@ if (commandLine.hasSwitch(ChromeSwitches.DISABLE_WEB_NOTIFICATION_CUSTOM_LAYOUTS)) { return false; } - if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { return false; } if (hasImage) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java index 6b6bb196..243cf45 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java
@@ -10,11 +10,13 @@ import android.content.pm.PackageManager; import android.os.AsyncTask; import android.os.Bundle; +import android.os.StrictMode; import android.support.v7.app.AppCompatActivity; import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; import org.chromium.base.ApplicationStatus.ActivityStateListener; +import org.chromium.base.Log; import org.chromium.base.ThreadUtils; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; @@ -26,15 +28,19 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.concurrent.ExecutionException; /** * A simple activity that allows Chrome to expose print as an option in the share menu. */ public class PrintShareActivity extends AppCompatActivity { + private static final String TAG = "cr_printing"; + private static Set<Activity> sPendingShareActivities = Collections.synchronizedSet(new HashSet<Activity>()); private static ActivityStateListener sStateListener; + private static AsyncTask<Void, Void, Void> sStateChangeTask; /** * Enable the print sharing option. @@ -61,8 +67,10 @@ ApplicationStatus.registerStateListenerForAllActivities(sStateListener); boolean wasEmpty = sPendingShareActivities.isEmpty(); sPendingShareActivities.add(activity); + + waitForPendingStateChangeTask(); if (wasEmpty) { - new AsyncTask<Void, Void, Void>() { + sStateChangeTask = new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { if (sPendingShareActivities.isEmpty()) return null; @@ -76,6 +84,11 @@ @Override protected void onPostExecute(Void result) { + if (sStateChangeTask == this) { + sStateChangeTask = null; + } else { + waitForPendingStateChangeTask(); + } callback.run(); } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); @@ -85,11 +98,14 @@ } private static void unregisterActivity(final Activity activity) { + ThreadUtils.assertOnUiThread(); + sPendingShareActivities.remove(activity); if (!sPendingShareActivities.isEmpty()) return; ApplicationStatus.unregisterActivityStateListener(sStateListener); - new AsyncTask<Void, Void, Void>() { + waitForPendingStateChangeTask(); + sStateChangeTask = new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { if (!sPendingShareActivities.isEmpty()) return null; @@ -100,9 +116,34 @@ PackageManager.DONT_KILL_APP); return null; } + + @Override + protected void onPostExecute(Void result) { + if (sStateChangeTask == this) sStateChangeTask = null; + } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } + /** + * Waits for any pending state change operations to be completed. + * + * This will avoid timing issues described here: crbug.com/649453. + */ + private static void waitForPendingStateChangeTask() { + ThreadUtils.assertOnUiThread(); + + if (sStateChangeTask == null) return; + StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); + try { + sStateChangeTask.get(); + sStateChangeTask = null; + } catch (InterruptedException | ExecutionException e) { + Log.e(TAG, "Print state change task did not complete as expected"); + } finally { + StrictMode.setThreadPolicy(oldPolicy); + } + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java index 0db930f..fac8ca7c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -1196,7 +1196,7 @@ * {@link java.util.Iterator#remove()} will throw an * {@link UnsupportedOperationException}. */ - public ObserverList.RewindableIterator<TabObserver> getTabObservers() { + protected ObserverList.RewindableIterator<TabObserver> getTabObservers() { return mObservers.rewindableIterator(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java index fae9c8cc..9e054ec 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
@@ -317,6 +317,7 @@ mUiFrameListener.mSurfaceTexture.release(); } restoreContentWindow(); + mUiContents.destroy(); } @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java index 41b4f7b8..eb485d0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.tab; +import org.chromium.base.ObserverList; import org.chromium.base.ObserverList.RewindableIterator; /** @@ -12,6 +13,13 @@ public class TabTestUtils { /** + * @return The observers registered for the given tab. + */ + public static ObserverList.RewindableIterator<TabObserver> getTabObservers(Tab tab) { + return tab.getTabObservers(); + } + + /** * Simulates the first visually non empty paint for the given |tab|. * @param tab Tab on which the simulated event will be sent. */
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java index ca4af1b1..531b0ce5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java
@@ -11,6 +11,7 @@ import org.chromium.base.ObserverList; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.chrome.browser.tab.TabTestUtils; import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; import org.chromium.content_public.browser.LoadUrlParams; @@ -122,7 +123,8 @@ } private void assertTabHasObserver(Tab tab, TabObserver observer) { - ObserverList.RewindableIterator<TabObserver> tabObservers = tab.getTabObservers(); + ObserverList.RewindableIterator<TabObserver> tabObservers = + TabTestUtils.getTabObservers(tab); tabObservers.rewind(); boolean containsObserver = false; while (tabObservers.hasNext()) { @@ -135,7 +137,8 @@ } private void assertTabDoesNotHaveObserver(Tab tab, TabObserver observer) { - ObserverList.RewindableIterator<TabObserver> tabObservers = tab.getTabObservers(); + ObserverList.RewindableIterator<TabObserver> tabObservers = + TabTestUtils.getTabObservers(tab); tabObservers.rewind(); while (tabObservers.hasNext()) { MoreAsserts.assertNotEqual(tabObservers.next(), observer);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java index a745edd..a637194d 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java
@@ -22,6 +22,7 @@ import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.chrome.browser.tab.TabTestUtils; import org.chromium.chrome.browser.util.ColorUtils; import org.chromium.chrome.test.ChromeActivityTestCaseBase; import org.chromium.chrome.test.util.ChromeRestriction; @@ -173,7 +174,7 @@ @Override public void run() { Tab tab = getActivity().getActivityTab(); - RewindableIterator<TabObserver> observers = tab.getTabObservers(); + RewindableIterator<TabObserver> observers = TabTestUtils.getTabObservers(tab); while (observers.hasNext()) { observers.next().onLoadStarted(tab, true); }
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index c4ce7e3..8b5e3eb 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -6038,12 +6038,6 @@ <message name="IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION" desc="Description for the flag to enable experimental Web Platform features."> Enables experimental Web Platform features that are in development. </message> - <message name="IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_V1_SPEC_CAPTURING_NAME" desc="Name for the flag to enable pointer event v1 spec capturing."> - Pointer event v1 spec capturing - </message> - <message name="IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_V1_SPEC_CAPTURING_DESCRIPTION" desc="Description for the flag to enable pointer event v1 spec capturing."> - Disables implicit capturing of touch pointer events. - </message> <message name="IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_NAME" desc="Name for the flag to enable the experimental pointer events."> Pointer Events </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 8d49c794..24a4e33 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -4249,6 +4249,10 @@ if (enable_extensions) { sources += [ + "extensions/chrome_extension_test_notification_observer.cc", + "extensions/chrome_extension_test_notification_observer.h", + "extensions/chrome_test_extension_loader.cc", + "extensions/chrome_test_extension_loader.h", "extensions/extension_action_test_util.cc", "extensions/extension_action_test_util.h", ]
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 2d5e244..4af4e836 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2025,10 +2025,6 @@ {"enable-feature-policy", IDS_FLAGS_FEATURE_POLICY_NAME, IDS_FLAGS_FEATURE_POLICY_DESCRIPTION, kOsAll, FEATURE_VALUE_TYPE(features::kFeaturePolicy)}, - {"enable-pointer-event-v1-spec-capturing-behavior", - IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_V1_SPEC_CAPTURING_NAME, - IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_V1_SPEC_CAPTURING_DESCRIPTION, kOsAll, - FEATURE_VALUE_TYPE(features::kPointerEventV1SpecCapturing)}, #if defined(OS_CHROMEOS) {"enable-emoji-handwriting-voice-on-ime-menu", IDS_FLAGS_ENABLE_EHV_INPUT_NAME, IDS_FLAGS_ENABLE_EHV_INPUT_DESCRIPTION,
diff --git a/chrome/browser/chromeos/policy/device_active_directory_policy_manager.h b/chrome/browser/chromeos/policy/device_active_directory_policy_manager.h index ab3a41b9..0859fb4 100644 --- a/chrome/browser/chromeos/policy/device_active_directory_policy_manager.h +++ b/chrome/browser/chromeos/policy/device_active_directory_policy_manager.h
@@ -34,7 +34,7 @@ void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) override; void OnStoreError(CloudPolicyStore* cloud_policy_store) override; - const CloudPolicyStore* store() const { return store_.get(); } + CloudPolicyStore* store() const { return store_.get(); } private: // Publishes the policy that's currently cached in the store.
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc index 46f96083..f7cec97 100644 --- a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc +++ b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc
@@ -61,8 +61,7 @@ std::unique_ptr<DeviceCloudPolicyValidator> validator( CreateValidator(policy)); validator->ValidateSignatureAllowingRotation( - public_key->as_string(), GetPolicyVerificationKey(), - install_attributes_->GetDomain()); + public_key->as_string(), install_attributes_->GetDomain()); validator->ValidateAgainstCurrentPolicy( device_settings_service_->policy_data(), CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED, @@ -90,8 +89,7 @@ std::unique_ptr<DeviceCloudPolicyValidator> validator( CreateValidator(policy)); - validator->ValidateInitialKey(GetPolicyVerificationKey(), - install_attributes_->GetDomain()); + validator->ValidateInitialKey(install_attributes_->GetDomain()); validator.release()->StartValidation( base::Bind(&DeviceCloudPolicyStoreChromeOS::OnPolicyToStoreValidated, weak_factory_.GetWeakPtr()));
diff --git a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc index 1b606d0..3338b0d 100644 --- a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc +++ b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
@@ -186,7 +186,7 @@ // TODO(mnissler): Plumb the enrolling user's username into this object so we // can validate the username on the resulting policy, and use the domain from // that username to validate the key below (http://crbug.com/343074). - validator->ValidateInitialKey(GetPolicyVerificationKey(), domain); + validator->ValidateInitialKey(domain); validator.release()->StartValidation( base::Bind(&EnrollmentHandlerChromeOS::HandlePolicyValidationResult, weak_ptr_factory_.GetWeakPtr()));
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc index b99fae20..0893816 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc
@@ -150,12 +150,10 @@ std::move(policy), CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED); validator->ValidateUsername(account_id_.GetUserEmail(), true); if (cached_policy_key_.empty()) { - validator->ValidateInitialKey(GetPolicyVerificationKey(), - ExtractDomain(account_id_.GetUserEmail())); + validator->ValidateInitialKey(ExtractDomain(account_id_.GetUserEmail())); } else { validator->ValidateSignatureAllowingRotation( - cached_policy_key_, GetPolicyVerificationKey(), - ExtractDomain(account_id_.GetUserEmail())); + cached_policy_key_, ExtractDomain(account_id_.GetUserEmail())); } // Start validation. The Validator will delete itself once validation is
diff --git a/chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc b/chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc index f34342e..82c6954f 100644 --- a/chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc +++ b/chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc
@@ -121,7 +121,7 @@ } // base::CriticalMemoryPressureMonitor: - MemoryPressureLevel GetCurrentPressureLevel() const override { + MemoryPressureLevel GetCurrentPressureLevel() override { return memory_pressure_level_; } void SetDispatchCallback(const DispatchCallback& callback) override {}
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chrome/browser/extensions/api/content_settings/content_settings_api.cc index c5e4834a2..405ad5b0 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_api.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_api.cc
@@ -53,7 +53,7 @@ return false; // We remove the ContentSettingsType parameter since this is added by the // renderer, and is not part of the JSON schema. - args->Remove(0, NULL); + args->Remove(0, nullptr); *content_type = extensions::content_settings_helpers::StringToContentSettingsType( content_type_str); @@ -154,9 +154,8 @@ ContentSetting setting; if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { // TODO(jochen): Do we return the value for setting or for reading cookies? - bool setting_cookie = false; - setting = cookie_settings->GetCookieSetting(primary_url, secondary_url, - setting_cookie, NULL); + cookie_settings->GetCookieSetting(primary_url, secondary_url, nullptr, + nullptr /* reading_setting */, &setting); } else { setting = map->GetContentSetting(primary_url, secondary_url, content_type, resource_identifier);
diff --git a/chrome/browser/extensions/chrome_extension_test_notification_observer.cc b/chrome/browser/extensions/chrome_extension_test_notification_observer.cc index 3daa0038..eb2498c2 100644 --- a/chrome/browser/extensions/chrome_extension_test_notification_observer.cc +++ b/chrome/browser/extensions/chrome_extension_test_notification_observer.cc
@@ -52,6 +52,10 @@ browser_(browser) {} ChromeExtensionTestNotificationObserver:: + ChromeExtensionTestNotificationObserver(content::BrowserContext* context) + : ExtensionTestNotificationObserver(context), browser_(nullptr) {} + +ChromeExtensionTestNotificationObserver:: ~ChromeExtensionTestNotificationObserver() {} content::BrowserContext* @@ -67,6 +71,7 @@ bool ChromeExtensionTestNotificationObserver:: WaitForPageActionVisibilityChangeTo(int count) { + DCHECK(browser_); ScopedObserver<extensions::ExtensionActionAPI, extensions::ExtensionActionAPI::Observer> observer(this);
diff --git a/chrome/browser/extensions/chrome_extension_test_notification_observer.h b/chrome/browser/extensions/chrome_extension_test_notification_observer.h index e36b304c..2389ad9 100644 --- a/chrome/browser/extensions/chrome_extension_test_notification_observer.h +++ b/chrome/browser/extensions/chrome_extension_test_notification_observer.h
@@ -24,6 +24,8 @@ public extensions::ExtensionActionAPI::Observer { public: explicit ChromeExtensionTestNotificationObserver(Browser* browser); + explicit ChromeExtensionTestNotificationObserver( + content::BrowserContext* browser_context); ~ChromeExtensionTestNotificationObserver() override; // Waits for the number of visible page actions to change to |count|.
diff --git a/chrome/browser/extensions/chrome_test_extension_loader.cc b/chrome/browser/extensions/chrome_test_extension_loader.cc new file mode 100644 index 0000000..9a44002 --- /dev/null +++ b/chrome/browser/extensions/chrome_test_extension_loader.cc
@@ -0,0 +1,224 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/chrome_test_extension_loader.h" + +#include <memory> + +#include "base/files/file_util.h" +#include "base/run_loop.h" +#include "chrome/browser/extensions/chrome_extension_test_notification_observer.h" +#include "chrome/browser/extensions/crx_installer.h" +#include "chrome/browser/extensions/extension_creator.h" +#include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/extension_util.h" +#include "chrome/browser/extensions/unpacked_installer.h" +#include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_source.h" +#include "content/public/test/test_utils.h" +#include "extensions/browser/extension_registry.h" +#include "extensions/browser/extension_system.h" +#include "extensions/browser/notification_types.h" +#include "extensions/browser/test_extension_registry_observer.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace extensions { + +ChromeTestExtensionLoader::ChromeTestExtensionLoader( + content::BrowserContext* browser_context) + : browser_context_(browser_context), + extension_system_(ExtensionSystem::Get(browser_context)), + extension_service_(extension_system_->extension_service()), + extension_registry_(ExtensionRegistry::Get(browser_context)) {} + +ChromeTestExtensionLoader::~ChromeTestExtensionLoader() {} + +scoped_refptr<const Extension> ChromeTestExtensionLoader::LoadExtension( + const base::FilePath& path) { + scoped_refptr<const Extension> extension; + if (path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { + extension = LoadCrx(path); + } else if (pack_extension_) { + base::FilePath crx_path = PackExtension(path); + if (crx_path.empty()) + return nullptr; + extension = LoadCrx(crx_path); + } else { + extension = LoadUnpacked(path); + } + + if (should_fail_ && extension) + ADD_FAILURE() << "Expected extension installation failure, but succeeded"; + else if (!should_fail_ && !extension) + ADD_FAILURE() << "Failed to install extension"; + + if (!extension) + return nullptr; + + extension_id_ = extension->id(); + extension = nullptr; + CheckPermissions(extension_id_); + + if (!install_param_.empty()) { + ExtensionPrefs::Get(browser_context_) + ->SetInstallParam(extension_id_, install_param_); + // Reload the extension so listeners of the loaded notification have access + // to the install param. + TestExtensionRegistryObserver registry_observer(extension_registry_, + extension_id_); + extension_service_->ReloadExtension(extension_id_); + registry_observer.WaitForExtensionLoaded(); + } + + extension = extension_registry_->enabled_extensions().GetByID(extension_id_); + if (!extension) + return nullptr; + if (!CheckErrors(*extension)) + return nullptr; + + base::RunLoop().RunUntilIdle(); + if (!WaitForExtensionReady()) { + ADD_FAILURE() << "Failed to wait for extension ready"; + return nullptr; + } + return extension; +} + +bool ChromeTestExtensionLoader::WaitForExtensionReady() { + return ChromeExtensionTestNotificationObserver(browser_context_) + .WaitForExtensionViewsToLoad(); +} + +base::FilePath ChromeTestExtensionLoader::PackExtension( + const base::FilePath& unpacked_path) { + if (!base::PathExists(unpacked_path)) { + ADD_FAILURE() << "Unpacked path does not exist: " << unpacked_path.value(); + return base::FilePath(); + } + + base::FilePath crx_path = temp_dir_.GetPath().AppendASCII("temp.crx"); + if (base::PathExists(crx_path)) { + ADD_FAILURE() << "Crx path exists: " << crx_path.value() + << ", are you trying to reuse the same ChromeTestExtensionLoader?"; + return base::FilePath(); + } + base::FilePath fallback_pem_path = + temp_dir_.GetPath().AppendASCII("temp.pem"); + if (base::PathExists(fallback_pem_path)) { + ADD_FAILURE() << "PEM path exists: " << fallback_pem_path.value() + << ", are you trying to reuse the same ChromeTestExtensionLoader?"; + return base::FilePath(); + } + + base::FilePath* pem_path_to_use = &fallback_pem_path; + if (!pem_path_.empty()) { + pem_path_to_use = &pem_path_; + if (!base::PathExists(pem_path_)) { + ADD_FAILURE() << "Provided PEM path does not exist: " + << pem_path_.value(); + return base::FilePath(); + } + } + + ExtensionCreator creator; + if (!creator.Run(unpacked_path, crx_path, *pem_path_to_use, fallback_pem_path, + ExtensionCreator::kOverwriteCRX)) { + ADD_FAILURE() << "ExtensionCreator::Run() failed: " + << creator.error_message(); + return base::FilePath(); + } + + CHECK(base::PathExists(crx_path)); + + return crx_path; +} + +scoped_refptr<const Extension> ChromeTestExtensionLoader::LoadCrx( + const base::FilePath& file_path) { + if (!file_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { + ADD_FAILURE() << "Must pass a crx path to LoadCrx()"; + return nullptr; + } + + scoped_refptr<const Extension> extension; + { + // TODO(devlin): Allow consumers to specify the install ui type. + std::unique_ptr<ExtensionInstallPrompt> install_ui; + scoped_refptr<CrxInstaller> installer = + CrxInstaller::Create(extension_service_, std::move(install_ui)); + installer->set_expected_id(expected_id_); + installer->set_creation_flags(creation_flags_); + installer->set_install_source(location_); + installer->set_install_immediately(install_immediately_); + installer->set_allow_silent_install(grant_permissions_); + if (!installer->is_gallery_install()) { + installer->set_off_store_install_allow_reason( + CrxInstaller::OffStoreInstallAllowedInTest); + } + + content::WindowedNotificationObserver install_observer( + NOTIFICATION_CRX_INSTALLER_DONE, + content::Source<CrxInstaller>(installer.get())); + installer->InstallCrx(file_path); + install_observer.Wait(); + + extension = + content::Details<const Extension>(install_observer.details()).ptr(); + } + + return extension; +} + +void ChromeTestExtensionLoader::CheckPermissions( + const std::string& extension_id) { + std::string id = extension_id; + + // Toggling incognito or file access will reload the extension, so wait for + // the reload. + if (allow_file_access_ != util::AllowFileAccess(id, browser_context_)) { + TestExtensionRegistryObserver registry_observer(extension_registry_, id); + util::SetAllowFileAccess(id, browser_context_, allow_file_access_); + registry_observer.WaitForExtensionLoaded(); + } + + if (allow_incognito_access_ != + util::IsIncognitoEnabled(id, browser_context_)) { + TestExtensionRegistryObserver registry_observer(extension_registry_, id); + util::SetIsIncognitoEnabled(id, browser_context_, true); + registry_observer.WaitForExtensionLoaded(); + } +} + +scoped_refptr<const Extension> ChromeTestExtensionLoader::LoadUnpacked( + const base::FilePath& file_path) { + const Extension* extension = nullptr; + TestExtensionRegistryObserver registry_observer(extension_registry_); + scoped_refptr<UnpackedInstaller> installer = + UnpackedInstaller::Create(extension_service_); + installer->set_prompt_for_plugins(false); + installer->set_require_modern_manifest_version( + require_modern_manifest_version_); + installer->Load(file_path); + extension = registry_observer.WaitForExtensionLoaded(); + + return extension; +} + +bool ChromeTestExtensionLoader::CheckErrors(const Extension& extension) { + if (ignore_manifest_warnings_) + return true; + const std::vector<InstallWarning>& install_warnings = + extension.install_warnings(); + if (install_warnings.empty()) + return true; + + std::string install_warnings_message = "Unexpected warnings for extension:\n"; + for (const InstallWarning& warning : install_warnings) + install_warnings_message += " " + warning.message + "\n"; + + ADD_FAILURE() << install_warnings_message; + return false; +} + +} // namespace extensions
diff --git a/chrome/browser/extensions/chrome_test_extension_loader.h b/chrome/browser/extensions/chrome_test_extension_loader.h new file mode 100644 index 0000000..c070463 --- /dev/null +++ b/chrome/browser/extensions/chrome_test_extension_loader.h
@@ -0,0 +1,163 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_CHROME_TEST_EXTENSION_LOADER_H_ +#define CHROME_BROWSER_EXTENSIONS_CHROME_TEST_EXTENSION_LOADER_H_ + +#include <string> + +#include "base/files/file_path.h" +#include "base/files/scoped_temp_dir.h" +#include "base/macros.h" +#include "extensions/common/extension.h" +#include "extensions/common/manifest.h" + +namespace base { +class FilePath; +} + +namespace content { +class BrowserContext; +} + +class ExtensionService; + +namespace extensions { +class ExtensionRegistry; +class ExtensionSystem; + +// A test class to help with loading packed or unpacked extensions. Designed to +// be used by both browser tests and unit tests. Note that this should be used +// for a single extension, and is designed to be used on the stack (rather than +// as a test suite member). +class ChromeTestExtensionLoader { + public: + explicit ChromeTestExtensionLoader(content::BrowserContext* browser_context); + ~ChromeTestExtensionLoader(); + + // Loads the extension specified by |file_path|. Works for both packed and + // unpacked extensions. + scoped_refptr<const Extension> LoadExtension(const base::FilePath& file_path); + + // Myriad different settings. See the member variable declarations for + // explanations and defaults. + // Prefer using these setters rather than adding n different + // LoadExtensionWith* variants (that's not scalable). + void set_expected_id(const std::string& expected_id) { + expected_id_ = expected_id; + } + void add_creation_flag(Extension::InitFromValueFlags flag) { + creation_flags_ |= flag; + } + void set_creation_flags(int flags) { creation_flags_ = flags; } + void set_location(Manifest::Location location) { location_ = location; } + void set_should_fail(bool should_fail) { should_fail_ = should_fail; } + void set_pack_extension(bool pack_extension) { + pack_extension_ = pack_extension; + } + void set_install_immediately(bool install_immediately) { + install_immediately_ = install_immediately; + } + void set_grant_permissions(bool grant_permissions) { + grant_permissions_ = grant_permissions; + } + void set_allow_file_access(bool allow_file_access) { + allow_file_access_ = allow_file_access; + } + void set_allow_incognito_access(bool allow_incognito_access) { + allow_incognito_access_ = allow_incognito_access; + } + void set_ignore_manifest_warnings(bool ignore_manifest_warnings) { + ignore_manifest_warnings_ = ignore_manifest_warnings; + } + void set_require_modern_manifest_version(bool require_modern_version) { + require_modern_manifest_version_ = require_modern_version; + } + void set_install_param(const std::string& install_param) { + install_param_ = install_param; + } + + private: + // Packs the extension at |unpacked_path| and returns the path to the created + // crx. Note that the created crx is tied to the lifetime of |this|. + base::FilePath PackExtension(const base::FilePath& unpacked_path); + + // Loads the crx pointed to by |crx_path|. + scoped_refptr<const Extension> LoadCrx(const base::FilePath& crx_path); + + // Loads the unpacked extension pointed to by |unpacked_path|. + scoped_refptr<const Extension> LoadUnpacked( + const base::FilePath& unpacked_path); + + // Checks that the permissions of the loaded extension are correct. + void CheckPermissions(const std::string& extension_id); + + // Checks for any errors associated with the extension. + bool CheckErrors(const Extension& extension); + + // Waits for the extension to finish setting up. + bool WaitForExtensionReady(); + + // The associated context and services. + content::BrowserContext* browser_context_ = nullptr; + ExtensionSystem* extension_system_ = nullptr; + ExtensionService* extension_service_ = nullptr; + ExtensionRegistry* extension_registry_ = nullptr; + + // A temporary directory for packing extensions. + base::ScopedTempDir temp_dir_; + + // The extension id of the loaded extension. + std::string extension_id_; + + // A provided PEM path to use. If not provided, a temporary one will be + // created. + base::FilePath pem_path_; + + // The expected extension id, if any. + std::string expected_id_; + + // An install param to use with the loaded extension. + std::string install_param_; + + // Any creation flags (see Extension::InitFromValueFlags) to use for the + // extension. Only used for crx installs. + int creation_flags_ = Extension::NO_FLAGS; + + // The install location of the added extension. + Manifest::Location location_ = Manifest::INTERNAL; + + // Whether or not the installation should fail. + bool should_fail_ = false; + + // Whether or not to always pack the extension before loading it. Otherwise, + // the extension will be loaded as an unpacked extension. + bool pack_extension_ = false; + + // Whether or not to install the extension immediately. Only used for crx + // installs. + bool install_immediately_ = true; + + // Whether or not to automatically grant permissions to the installed + // extension. Only used for crx installs. + bool grant_permissions_ = true; + + // Whether or not to allow file access by default to the extension. + bool allow_file_access_ = false; + + // Whether or not to allow incognito access by default to the extension. + bool allow_incognito_access_ = false; + + // Whether or not to ignore manifest warnings during installation. + bool ignore_manifest_warnings_ = false; + + // Whether or not to enforce a minimum manifest version requirement. + bool require_modern_manifest_version_ = true; + + DISALLOW_COPY_AND_ASSIGN(ChromeTestExtensionLoader); +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_CHROME_TEST_EXTENSION_LOADER_H_
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 388fb740..54c013a 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -19,6 +19,7 @@ #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "chrome/browser/extensions/browsertest_util.h" +#include "chrome/browser/extensions/chrome_test_extension_loader.h" #include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_creator.h" @@ -175,117 +176,22 @@ return LoadExtensionWithInstallParam(path, flags, std::string()); } -const extensions::Extension* -ExtensionBrowserTest::LoadExtensionWithInstallParam( +const Extension* ExtensionBrowserTest::LoadExtensionWithInstallParam( const base::FilePath& path, int flags, const std::string& install_param) { - ExtensionService* service = extensions::ExtensionSystem::Get( - profile())->extension_service(); - ExtensionRegistry* registry = ExtensionRegistry::Get(profile()); - { - observer_->Watch(extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, - content::NotificationService::AllSources()); - - scoped_refptr<extensions::UnpackedInstaller> installer( - extensions::UnpackedInstaller::Create(service)); - installer->set_prompt_for_plugins(false); - installer->set_require_modern_manifest_version( - (flags & kFlagAllowOldManifestVersions) == 0); - installer->Load(path); - - observer_->Wait(); - } - - // Find the loaded extension by its path. See crbug.com/59531 for why - // we cannot just use last_loaded_extension_id(). - const Extension* extension = - GetExtensionByPath(registry->enabled_extensions(), path); - if (!extension) - return NULL; - - if (!(flags & kFlagIgnoreManifestWarnings)) { - const std::vector<extensions::InstallWarning>& install_warnings = - extension->install_warnings(); - if (!install_warnings.empty()) { - std::string install_warnings_message = base::StringPrintf( - "Unexpected warnings when loading test extension %s:\n", - path.AsUTF8Unsafe().c_str()); - - for (std::vector<extensions::InstallWarning>::const_iterator it = - install_warnings.begin(); it != install_warnings.end(); ++it) { - install_warnings_message += " " + it->message + "\n"; - } - - EXPECT_EQ(0u, extension->install_warnings().size()) - << install_warnings_message; - return NULL; - } - } - - const std::string extension_id = extension->id(); - - // If this is an incognito test (e.g. where the test fixture appended the - // --incognito flag), we need to use the original profile when we wait for - // notifications. - Profile* original_profile = profile()->GetOriginalProfile(); - - if (!install_param.empty()) { - extensions::ExtensionPrefs::Get(original_profile) - ->SetInstallParam(extension_id, install_param); - // Re-enable the extension if needed. - if (registry->enabled_extensions().Contains(extension_id)) { - content::WindowedNotificationObserver load_signal( - extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, - content::Source<Profile>(original_profile)); - // Reload the extension so that the - // NOTIFICATION_EXTENSION_LOADED_DEPRECATED - // observers may access |install_param|. - service->ReloadExtension(extension_id); - load_signal.Wait(); - extension = service->GetExtensionById(extension_id, false); - CHECK(extension) << extension_id << " not found after reloading."; - } - } - - // Toggling incognito or file access will reload the extension, so wait for - // the reload and grab the new extension instance. The default state is - // incognito disabled and file access enabled, so we don't wait in those - // cases. - { - content::WindowedNotificationObserver load_signal( - extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, - content::Source<Profile>(original_profile)); - CHECK(!extensions::util::IsIncognitoEnabled(extension_id, original_profile)) - << extension_id << " is enabled in incognito, but shouldn't be"; - - if (flags & kFlagEnableIncognito) { - extensions::util::SetIsIncognitoEnabled(extension_id, original_profile, - true); - load_signal.Wait(); - extension = service->GetExtensionById(extension_id, false); - CHECK(extension) << extension_id << " not found after reloading."; - } - } - - { - content::WindowedNotificationObserver load_signal( - extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, - content::Source<Profile>(original_profile)); - CHECK(extensions::util::AllowFileAccess(extension_id, original_profile)); - if (!(flags & kFlagEnableFileAccess)) { - extensions::util::SetAllowFileAccess(extension_id, original_profile, - false); - load_signal.Wait(); - extension = service->GetExtensionById(extension_id, false); - CHECK(extension) << extension_id << " not found after reloading."; - } - } - - if (!observer_->WaitForExtensionViewsToLoad()) - return NULL; - - return extension; + extensions::ChromeTestExtensionLoader loader(profile()); + loader.set_require_modern_manifest_version( + (flags & kFlagAllowOldManifestVersions) == 0); + loader.set_ignore_manifest_warnings( + (flags & kFlagIgnoreManifestWarnings) != 0); + loader.set_allow_incognito_access((flags & kFlagEnableIncognito) != 0); + loader.set_allow_file_access((flags & kFlagEnableFileAccess) != 0); + loader.set_install_param(install_param); + scoped_refptr<const Extension> extension = loader.LoadExtension(path); + if (extension) + observer_->set_last_loaded_extension_id(extension->id()); + return extension.get(); } const Extension* ExtensionBrowserTest::LoadExtensionAsComponentWithManifest(
diff --git a/chrome/browser/extensions/extension_service_test_with_install.cc b/chrome/browser/extensions/extension_service_test_with_install.cc index 83582c7..e4706a1 100644 --- a/chrome/browser/extensions/extension_service_test_with_install.cc +++ b/chrome/browser/extensions/extension_service_test_with_install.cc
@@ -6,9 +6,11 @@ #include "base/files/file_util.h" #include "base/strings/utf_string_conversions.h" +#include "chrome/browser/extensions/chrome_test_extension_loader.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_creator.h" #include "chrome/browser/extensions/extension_error_reporter.h" +#include "chrome/browser/profiles/profile.h" #include "content/public/browser/notification_service.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/notification_types.h" @@ -417,22 +419,18 @@ Manifest::Location install_location, InstallState install_state, int creation_flags) { - EXPECT_TRUE(base::PathExists(crx_path)) << "Path does not exist: " - << crx_path.value().c_str(); - // no client (silent install) - scoped_refptr<CrxInstaller> installer( - CrxInstaller::CreateSilent(service())); - installer->set_install_source(install_location); - installer->set_creation_flags(creation_flags); - if (!(creation_flags & Extension::WAS_INSTALLED_BY_DEFAULT)) - installer->set_allow_silent_install(true); - - content::WindowedNotificationObserver observer( - extensions::NOTIFICATION_CRX_INSTALLER_DONE, - content::Source<extensions::CrxInstaller>(installer.get())); - - installer->InstallCrx(crx_path); - observer.Wait(); + ChromeTestExtensionLoader extension_loader(profile()); + extension_loader.set_location(install_location); + extension_loader.set_creation_flags(creation_flags); + extension_loader.set_should_fail(install_state == INSTALL_FAILED); + // TODO(devlin): We shouldn't be granting permissions based on whether + // something was installed by default. That's weird. + extension_loader.set_grant_permissions( + (creation_flags & Extension::WAS_INSTALLED_BY_DEFAULT) == 0); + // TODO(devlin): We shouldn't ignore manifest warnings here, but we always + // did so a bunch of stuff fails. Migrate this over. + extension_loader.set_ignore_manifest_warnings(true); + extension_loader.LoadExtension(crx_path); } } // namespace extensions
diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc index ec38785..31d58fb 100644 --- a/chrome/browser/lifetime/application_lifetime.cc +++ b/chrome/browser/lifetime/application_lifetime.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/lifetime/application_lifetime.h" #include <memory> +#include <string> #if defined(OS_WIN) #include <windows.h> @@ -36,6 +37,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/features.h" #include "chrome/common/pref_names.h" +#include "components/metrics/metrics_service.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_details.h" @@ -53,7 +55,6 @@ #if defined(OS_WIN) #include "base/win/win_util.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" -#include "chrome/common/chrome_constants.h" #endif namespace chrome { @@ -305,6 +306,9 @@ // exit this function. ShutdownWatcherHelper shutdown_watcher; shutdown_watcher.Arm(base::TimeDelta::FromSeconds(90)); + metrics::MetricsService::SetExecutionPhase( + metrics::MetricsService::SHUTDOWN_TIMEBOMB_ARM, + g_browser_process->local_state()); browser_shutdown::OnShutdownStarting(browser_shutdown::END_SESSION);
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc index 81712b7a..585f09d 100644 --- a/chrome/browser/net/chrome_network_delegate.cc +++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -542,10 +542,11 @@ if (!cookie_settings_.get()) return false; - bool reading_cookie_allowed = cookie_settings_->IsReadingCookieAllowed( - url, first_party_for_cookies); - bool setting_cookie_allowed = cookie_settings_->IsSettingCookieAllowed( - url, first_party_for_cookies); + bool reading_cookie_allowed = false; + bool setting_cookie_allowed = false; + cookie_settings_->GetReadingAndSettingCookieAllowed( + url, first_party_for_cookies, &reading_cookie_allowed, + &setting_cookie_allowed); bool privacy_mode = !(reading_cookie_allowed && setting_cookie_allowed); return privacy_mode; }
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc index 6d3afdc..a660dff 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc
@@ -143,8 +143,8 @@ // Instead, instances are instantiated via CreateServiceNow(). DCHECK(!testing_factory_); - std::unique_ptr<UserCloudPolicyStore> store(UserCloudPolicyStore::Create( - context->GetPath(), GetPolicyVerificationKey(), background_task_runner)); + std::unique_ptr<UserCloudPolicyStore> store( + UserCloudPolicyStore::Create(context->GetPath(), background_task_runner)); if (force_immediate_load) store->LoadImmediately();
diff --git a/chrome/browser/predictors/resource_prefetch_common.cc b/chrome/browser/predictors/resource_prefetch_common.cc index 2b97faf37..b177fca2 100644 --- a/chrome/browser/predictors/resource_prefetch_common.cc +++ b/chrome/browser/predictors/resource_prefetch_common.cc
@@ -4,12 +4,10 @@ #include "chrome/browser/predictors/resource_prefetch_common.h" -#include <stdlib.h> +#include <string> #include <tuple> #include "base/command_line.h" -#include "base/metrics/field_trial.h" -#include "base/strings/string_split.h" #include "chrome/browser/net/prediction_options.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" @@ -19,34 +17,17 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" -using base::FieldTrialList; -using std::string; -using std::vector; - namespace predictors { -const char kSpeculativePrefetchingTrialName[] = - "SpeculativeResourcePrefetching"; +namespace { -/* - * SpeculativeResourcePrefetching is a field trial, and its value must have the - * following format: key1=value1:key2=value2:key3=value3 - * e.g. "Prefetching=Enabled:Predictor=Url:Confidence=High" - * The function below extracts the value corresponding to a key provided from - * the SpeculativeResourcePrefetching field trial. - */ -std::string GetFieldTrialSpecValue(string key) { - std::string trial_name = - FieldTrialList::FindFullName(kSpeculativePrefetchingTrialName); - for (const base::StringPiece& element : base::SplitStringPiece( - trial_name, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { - std::vector<base::StringPiece> key_value = base::SplitStringPiece( - element, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - if (key_value.size() == 2 && key_value[0] == key) - return key_value[1].as_string(); - } - return string(); -} +constexpr int kLearningMode = ResourcePrefetchPredictorConfig::URL_LEARNING | + ResourcePrefetchPredictorConfig::HOST_LEARNING; +constexpr int kPrefetchingMode = + ResourcePrefetchPredictorConfig::URL_PREFETCHING | + ResourcePrefetchPredictorConfig::HOST_PREFETCHING; + +} // namespace bool IsSpeculativeResourcePrefetchingEnabled( Profile* profile, @@ -68,85 +49,15 @@ if (value == switches::kSpeculativeResourcePrefetchingDisabled) { return false; } else if (value == switches::kSpeculativeResourcePrefetchingLearning) { - config->mode |= ResourcePrefetchPredictorConfig::URL_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::HOST_LEARNING; + config->mode |= kLearningMode; return true; } else if (value == switches::kSpeculativeResourcePrefetchingEnabled) { - config->mode |= ResourcePrefetchPredictorConfig::URL_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::HOST_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::URL_PREFETCHING; - config->mode |= ResourcePrefetchPredictorConfig::HOST_PRFETCHING; + config->mode |= kLearningMode | kPrefetchingMode; return true; } } - // Disable if no field trial is specified. - std::string trial = base::FieldTrialList::FindFullName( - kSpeculativePrefetchingTrialName); - if (trial.empty()) - return false; - - // Enabled by field trial. - std::string spec_prefetching = GetFieldTrialSpecValue("Prefetching"); - std::string spec_predictor = GetFieldTrialSpecValue("Predictor"); - std::string spec_confidence = GetFieldTrialSpecValue("Confidence"); - std::string spec_more_resources = GetFieldTrialSpecValue("MoreResources"); - std::string spec_small_db = GetFieldTrialSpecValue("SmallDB"); - - if (spec_prefetching == "Learning") { - if (spec_predictor == "Url") { - config->mode |= ResourcePrefetchPredictorConfig::URL_LEARNING; - } else if (spec_predictor == "Host") { - config->mode |= ResourcePrefetchPredictorConfig::HOST_LEARNING; - } else { - // Default: both Url and Host - config->mode |= ResourcePrefetchPredictorConfig::URL_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::HOST_LEARNING; - } - } else if (spec_prefetching == "Enabled") { - if (spec_predictor == "Url") { - config->mode |= ResourcePrefetchPredictorConfig::URL_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::URL_PREFETCHING; - } else if (spec_predictor == "Host") { - config->mode |= ResourcePrefetchPredictorConfig::HOST_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::HOST_PRFETCHING; - } else { - // Default: both Url and Host - config->mode |= ResourcePrefetchPredictorConfig::URL_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::HOST_LEARNING; - config->mode |= ResourcePrefetchPredictorConfig::URL_PREFETCHING; - config->mode |= ResourcePrefetchPredictorConfig::HOST_PRFETCHING; - } - } else { - // Default: spec_prefetching == "Disabled" - return false; - } - - if (spec_confidence == "Low") { - config->min_url_visit_count = 1; - config->min_resource_confidence_to_trigger_prefetch = 0.5f; - config->min_resource_hits_to_trigger_prefetch = 1; - } else if (spec_confidence == "High") { - config->min_url_visit_count = 3; - config->min_resource_confidence_to_trigger_prefetch = 0.9f; - config->min_resource_hits_to_trigger_prefetch = 3; - } else { - // default - config->min_url_visit_count = 2; - config->min_resource_confidence_to_trigger_prefetch = 0.7f; - config->min_resource_hits_to_trigger_prefetch = 2; - } - - if (spec_more_resources == "Enabled") { - config->max_resources_per_entry = 100; - } - - if (spec_small_db == "Enabled") { - config->max_urls_to_track = 200; - config->max_hosts_to_track = 100; - } - - return true; + return false; } NavigationID::NavigationID() @@ -252,7 +163,7 @@ chrome_browser_net::NetworkPredictionStatus::ENABLED) { return false; } - return (mode & HOST_PRFETCHING) > 0; + return (mode & HOST_PREFETCHING) > 0; } bool ResourcePrefetchPredictorConfig::IsLowConfidenceForTest() const {
diff --git a/chrome/browser/predictors/resource_prefetch_common.h b/chrome/browser/predictors/resource_prefetch_common.h index 33812ff5..cfb422c 100644 --- a/chrome/browser/predictors/resource_prefetch_common.h +++ b/chrome/browser/predictors/resource_prefetch_common.h
@@ -69,10 +69,10 @@ // The mode the prefetcher is running in. Forms a bit map. enum Mode { - URL_LEARNING = 1 << 0, - HOST_LEARNING = 1 << 1, + URL_LEARNING = 1 << 0, + HOST_LEARNING = 1 << 1, URL_PREFETCHING = 1 << 2, // Should also turn on URL_LEARNING. - HOST_PRFETCHING = 1 << 3 // Should also turn on HOST_LEARNING. + HOST_PREFETCHING = 1 << 3 // Should also turn on HOST_LEARNING. }; int mode;
diff --git a/chrome/browser/predictors/resource_prefetch_common_unittest.cc b/chrome/browser/predictors/resource_prefetch_common_unittest.cc index 792f2d1..714518f 100644 --- a/chrome/browser/predictors/resource_prefetch_common_unittest.cc +++ b/chrome/browser/predictors/resource_prefetch_common_unittest.cc
@@ -2,20 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> +#include <string> + +#include "base/command_line.h" #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/field_trial.h" -#include "base/metrics/statistics_recorder.h" #include "chrome/browser/net/prediction_options.h" #include "chrome/browser/predictors/resource_prefetch_common.h" #include "chrome/browser/predictors/resource_prefetch_predictor.h" -#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/browser.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "components/prefs/pref_service.h" -#include "components/variations/entropy_provider.h" #include "content/public/test/test_browser_thread.h" #include "net/base/network_change_notifier.h" #include "testing/gtest/include/gtest/gtest.h" @@ -39,36 +39,24 @@ } }; -} // namespace +} // namespace namespace predictors { class ResourcePrefetchCommonTest : public testing::Test { public: ResourcePrefetchCommonTest(); - void SetUp() override; - - void CreateTestFieldTrial(const std::string& name, - const std::string& group_name) { - base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial( - name, group_name); - trial->group(); - } void SetPreference(NetworkPredictionOptions value) { profile_->GetPrefs()->SetInteger(prefs::kNetworkPredictionOptions, value); } - void TestIsPrefetchDisabled(ResourcePrefetchPredictorConfig& config) { - EXPECT_FALSE(config.IsLearningEnabled()); - EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get())); - EXPECT_FALSE(config.IsURLLearningEnabled()); - EXPECT_FALSE(config.IsHostLearningEnabled()); - EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get())); - EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get())); + void SetCommandLineValue(const std::string& value) { + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kSpeculativeResourcePrefetching, value); } - void TestIsPrefetchEnabled(ResourcePrefetchPredictorConfig& config) { + void TestIsPrefetchEnabled(const ResourcePrefetchPredictorConfig& config) { EXPECT_TRUE(config.IsLearningEnabled()); EXPECT_TRUE(config.IsPrefetchingEnabled(profile_.get())); EXPECT_TRUE(config.IsURLLearningEnabled()); @@ -77,7 +65,7 @@ EXPECT_TRUE(config.IsHostPrefetchingEnabled(profile_.get())); } - void TestIsPrefetchLearning(ResourcePrefetchPredictorConfig& config) { + void TestIsPrefetchLearning(const ResourcePrefetchPredictorConfig& config) { EXPECT_TRUE(config.IsLearningEnabled()); EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get())); EXPECT_TRUE(config.IsURLLearningEnabled()); @@ -86,7 +74,7 @@ EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get())); } - void TestIsDefaultExtraConfig(ResourcePrefetchPredictorConfig& config) { + void TestIsDefaultExtraConfig(const ResourcePrefetchPredictorConfig& config) { EXPECT_FALSE(config.IsLowConfidenceForTest()); EXPECT_FALSE(config.IsHighConfidenceForTest()); EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); @@ -97,9 +85,6 @@ base::MessageLoop loop_; content::TestBrowserThread ui_thread_; std::unique_ptr<TestingProfile> profile_; - - private: - std::unique_ptr<base::FieldTrialList> field_trial_list_; }; ResourcePrefetchCommonTest::ResourcePrefetchCommonTest() @@ -107,194 +92,45 @@ ui_thread_(content::BrowserThread::UI, &loop_), profile_(new TestingProfile()) { } -void ResourcePrefetchCommonTest::SetUp() { - field_trial_list_.reset(new base::FieldTrialList( - base::MakeUnique<metrics::SHA1EntropyProvider>( - "ResourcePrefetchCommonTest"))); - base::StatisticsRecorder::Initialize(); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialNotSpecified) { +TEST_F(ResourcePrefetchCommonTest, IsDisabledByDefault) { ResourcePrefetchPredictorConfig config; EXPECT_FALSE( IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchDisabled(config); -} -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingDisabled) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Disabled"); - ResourcePrefetchPredictorConfig config; - EXPECT_FALSE( - IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchDisabled(config); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialLearningHost) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Learning:Predictor=Host"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - EXPECT_TRUE(config.IsLearningEnabled()); + EXPECT_FALSE(config.IsLearningEnabled()); EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get())); EXPECT_FALSE(config.IsURLLearningEnabled()); - EXPECT_TRUE(config.IsHostLearningEnabled()); - EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get())); - EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get())); - TestIsDefaultExtraConfig(config); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialLearningURL) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Learning:Predictor=Url"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - EXPECT_TRUE(config.IsLearningEnabled()); - EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get())); - EXPECT_TRUE(config.IsURLLearningEnabled()); EXPECT_FALSE(config.IsHostLearningEnabled()); EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get())); EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get())); + TestIsDefaultExtraConfig(config); } -TEST_F(ResourcePrefetchCommonTest, FieldTrialLearning) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Learning"); +TEST_F(ResourcePrefetchCommonTest, EnableLearning) { + SetCommandLineValue("learning"); ResourcePrefetchPredictorConfig config; EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); TestIsPrefetchLearning(config); TestIsDefaultExtraConfig(config); } -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingHost) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled:Predictor=Host"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - EXPECT_TRUE(config.IsLearningEnabled()); - EXPECT_TRUE(config.IsPrefetchingEnabled(profile_.get())); - EXPECT_FALSE(config.IsURLLearningEnabled()); - EXPECT_TRUE(config.IsHostLearningEnabled()); - EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get())); - EXPECT_TRUE(config.IsHostPrefetchingEnabled(profile_.get())); - TestIsDefaultExtraConfig(config); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingURL) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled:Predictor=Url"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - EXPECT_TRUE(config.IsLearningEnabled()); - EXPECT_TRUE(config.IsPrefetchingEnabled(profile_.get())); - EXPECT_TRUE(config.IsURLLearningEnabled()); - EXPECT_FALSE(config.IsHostLearningEnabled()); - EXPECT_TRUE(config.IsURLPrefetchingEnabled(profile_.get())); - EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get())); - TestIsDefaultExtraConfig(config); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetching) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", "Prefetching=Enabled"); +TEST_F(ResourcePrefetchCommonTest, EnablePrefetch) { + SetCommandLineValue("enabled"); ResourcePrefetchPredictorConfig config; EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); TestIsPrefetchEnabled(config); TestIsDefaultExtraConfig(config); } -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingLowConfidence) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled:Confidence=Low"); +// Verifies whether prefetching is disabled according to the network type. But +// learning should not be disabled by network. +TEST_F(ResourcePrefetchCommonTest, RespectsNetworkSettings) { + SetCommandLineValue("enabled"); ResourcePrefetchPredictorConfig config; EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); TestIsPrefetchEnabled(config); - EXPECT_TRUE(config.IsLowConfidenceForTest()); - EXPECT_FALSE(config.IsHighConfidenceForTest()); - EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); - EXPECT_FALSE(config.IsSmallDBEnabledForTest()); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingHighConfidence) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled:Confidence=High"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchEnabled(config); - EXPECT_FALSE(config.IsLowConfidenceForTest()); - EXPECT_TRUE(config.IsHighConfidenceForTest()); - EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); - EXPECT_FALSE(config.IsSmallDBEnabledForTest()); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingMoreResources) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Learning:MoreResources=Enabled"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchLearning(config); - EXPECT_FALSE(config.IsLowConfidenceForTest()); - EXPECT_FALSE(config.IsHighConfidenceForTest()); - EXPECT_TRUE(config.IsMoreResourcesEnabledForTest()); - EXPECT_FALSE(config.IsSmallDBEnabledForTest()); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialLearningSmallDB) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Learning:SmallDB=Enabled"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchLearning(config); - EXPECT_FALSE(config.IsLowConfidenceForTest()); - EXPECT_FALSE(config.IsHighConfidenceForTest()); - EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); - EXPECT_TRUE(config.IsSmallDBEnabledForTest()); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingSmallDB) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled:SmallDB=Enabled"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchEnabled(config); - EXPECT_FALSE(config.IsLowConfidenceForTest()); - EXPECT_FALSE(config.IsHighConfidenceForTest()); - EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); - EXPECT_TRUE(config.IsSmallDBEnabledForTest()); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingSmallDBLowConfidence) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled:SmallDB=Enabled:Confidence=Low"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchEnabled(config); - EXPECT_TRUE(config.IsLowConfidenceForTest()); - EXPECT_FALSE(config.IsHighConfidenceForTest()); - EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); - EXPECT_TRUE(config.IsSmallDBEnabledForTest()); -} - -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingSmallDBHighConfidence) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled:SmallDB=Enabled:Confidence=High"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchEnabled(config); - EXPECT_FALSE(config.IsLowConfidenceForTest()); - EXPECT_TRUE(config.IsHighConfidenceForTest()); - EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); - EXPECT_TRUE(config.IsSmallDBEnabledForTest()); -} - -// Verifies whether prefetching in the field trial is disabled according to -// the network type. But learning should not be disabled by network. -TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingDisabledByNetwork) { - CreateTestFieldTrial("SpeculativeResourcePrefetching", - "Prefetching=Enabled"); - ResourcePrefetchPredictorConfig config; - EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); - TestIsPrefetchEnabled(config); + TestIsDefaultExtraConfig(config); // Set preference to WIFI_ONLY: prefetch when not on cellular. SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_WIFI_ONLY);
diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc index 16e72bf..d4cb8d2b6 100644 --- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
@@ -38,11 +38,6 @@ #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h" #endif -// TODO(ekaramad): The following tests should be active on all platforms. After -// fixing https://crbug.com/578168, this test file should be built for android -// as well and most of the following tests should be enabled for all platforms -//(https://crbug.com/602723). - /////////////////////////////////////////////////////////////////////////////// // TextInputManager and IME Tests // @@ -643,6 +638,57 @@ reset_state_observer.Wait(); } +// The following test verifies that when the active widget changes value, it is +// always from nullptr to non-null or vice versa. +IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, + ResetTextInputStateOnActiveWidgetChange) { + CreateIframePage("a(b,c(a,b),d)"); + std::vector<content::RenderFrameHost*> frames{ + GetFrame(IndexVector{}), GetFrame(IndexVector{0}), + GetFrame(IndexVector{1}), GetFrame(IndexVector{1, 0}), + GetFrame(IndexVector{1, 1}), GetFrame(IndexVector{2})}; + std::vector<content::RenderWidgetHostView*> views; + for (auto frame : frames) + views.push_back(frame->GetView()); + std::vector<std::string> values{"a", "ab", "ac", "aca", "acb", "acd"}; + for (size_t i = 0; i < frames.size(); ++i) + AddInputFieldToFrame(frames[i], "text", values[i], true); + + content::WebContents* web_contents = active_contents(); + + auto send_tab_and_wait_for_value = + [&web_contents](const std::string& expected_value) { + TextInputManagerValueObserver observer(web_contents, expected_value); + SimulateKeyPress(web_contents, ui::DomKey::TAB, ui::DomCode::TAB, + ui::VKEY_TAB, false, false, false, false); + observer.Wait(); + }; + + // Record all active view changes. + RecordActiveViewsObserver recorder(web_contents); + for (auto value : values) + send_tab_and_wait_for_value(value); + + // We have covered a total of 6 views, so there should at least be 11 entries + // recorded (at least one null between two views). + size_t record_count = recorder.active_views()->size(); + EXPECT_GT(record_count, 10U); + + // Verify we do not have subsequent nullptr or non-nullptrs. + for (size_t i = 0; i < record_count - 1U; ++i) { + const content::RenderWidgetHostView* current = + recorder.active_views()->at(i); + const content::RenderWidgetHostView* next = + recorder.active_views()->at(i + 1U); + EXPECT_TRUE((current != nullptr && next == nullptr) || + (current == nullptr && next != nullptr)); + } +} + +// TODO(ekaramad): Some of the following tests should be active on Android as +// well. Enable them when the corresponding feature is implemented for Android +// (https://crbug.com/602723). +#if !defined(OS_ANDROID) // This test creates a page with multiple child frames and adds an <input> to // each frame. Then, sequentially, each <input> is focused by sending a tab key. // Then, after |TextInputState.type| for a view is changed to text, the test @@ -801,57 +847,10 @@ } } -// The following test verifies that when the active widget changes value, it is -// always from nullptr to non-null or vice versa. -IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, - ResetTextInputStateOnActiveWidgetChange) { - CreateIframePage("a(b,c(a,b),d)"); - std::vector<content::RenderFrameHost*> frames{ - GetFrame(IndexVector{}), GetFrame(IndexVector{0}), - GetFrame(IndexVector{1}), GetFrame(IndexVector{1, 0}), - GetFrame(IndexVector{1, 1}), GetFrame(IndexVector{2})}; - std::vector<content::RenderWidgetHostView*> views; - for (auto frame : frames) - views.push_back(frame->GetView()); - std::vector<std::string> values{"a", "ab", "ac", "aca", "acb", "acd"}; - for (size_t i = 0; i < frames.size(); ++i) - AddInputFieldToFrame(frames[i], "text", values[i], true); - - content::WebContents* web_contents = active_contents(); - - auto send_tab_and_wait_for_value = - [&web_contents](const std::string& expected_value) { - TextInputManagerValueObserver observer(web_contents, expected_value); - SimulateKeyPress(web_contents, ui::DomKey::TAB, ui::DomCode::TAB, - ui::VKEY_TAB, false, false, false, false); - observer.Wait(); - }; - - // Record all active view changes. - RecordActiveViewsObserver recorder(web_contents); - for (auto value : values) - send_tab_and_wait_for_value(value); - - // We have covered a total of 6 views, so there should at least be 11 entries - // recorded (at least one null between two views). - size_t record_count = recorder.active_views()->size(); - EXPECT_GT(record_count, 10U); - - // Verify we do not have subsequent nullptr or non-nullptrs. - for (size_t i = 0; i < record_count - 1U; ++i) { - const content::RenderWidgetHostView* current = - recorder.active_views()->at(i); - const content::RenderWidgetHostView* next = - recorder.active_views()->at(i + 1U); - EXPECT_TRUE((current != nullptr && next == nullptr) || - (current == nullptr && next != nullptr)); - } -} // TODO(ekaramad): The following tests are specifically written for Aura and are // based on InputMethodObserver. Write similar tests for Mac/Android/Mus // (crbug.com/602723). - #if defined(USE_AURA) // ----------------------------------------------------------------------------- // Input Method Observer Tests @@ -1228,4 +1227,5 @@ // For the cleanup of the original WebContents in tab index 0. content::SetBrowserClientForTesting(old_browser_client); } -#endif +#endif // defined(MAC_OSX) +#endif // !defined(OS_ANDROID)
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm index a11e869..a8214d4 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
@@ -16,6 +16,7 @@ #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" #include "chrome/grit/generated_resources.h" #import "ui/base/cocoa/find_pasteboard.h" +#import "ui/base/cocoa/touch_bar_forward_declarations.h" #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/material_design/material_design_controller.h" @@ -96,6 +97,11 @@ return self; } +// Overridden to prevent unwanted items from appearing in the Touch Bar. +- (NSTouchBar*)makeTouchBar { + return nil; +} + - (void)updateColorsToMatchTheme { if (![[self window] inIncognitoMode]) { return;
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 421b6e0..d03f35d1 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -360,8 +360,8 @@ if (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) { content_settings::CookieSettings* cookie_settings = CookieSettingsFactory::GetForProfile(profile()).get(); - setting = cookie_settings->GetCookieSetting( - url, url, true, &setting_source); + cookie_settings->GetCookieSetting(url, url, &setting_source, nullptr, + &setting); } else { SettingInfo info; HostContentSettingsMap* map =
diff --git a/chrome/browser/ui/webui/policy_ui_handler.cc b/chrome/browser/ui/webui/policy_ui_handler.cc index 9705752..d9bb3cc 100644 --- a/chrome/browser/ui/webui/policy_ui_handler.cc +++ b/chrome/browser/ui/webui/policy_ui_handler.cc
@@ -309,7 +309,9 @@ }; // Provides status for DeviceActiveDirectoryPolicyManager. -class DeviceActiveDirectoryPolicyStatusProvider : public PolicyStatusProvider { +class DeviceActiveDirectoryPolicyStatusProvider + : public PolicyStatusProvider, + public policy::CloudPolicyStore::Observer { public: explicit DeviceActiveDirectoryPolicyStatusProvider( policy::DeviceActiveDirectoryPolicyManager* manager); @@ -318,8 +320,12 @@ // PolicyStatusProvider implementation. void GetStatus(base::DictionaryValue* dict) override; + // policy::CloudPolicyStore::Observer implementation. + void OnStoreLoaded(policy::CloudPolicyStore* store) override; + void OnStoreError(policy::CloudPolicyStore* store) override; + private: - const policy::CloudPolicyStore* store_; + policy::CloudPolicyStore* store_; DISALLOW_COPY_AND_ASSIGN(DeviceActiveDirectoryPolicyStatusProvider); }; @@ -437,10 +443,14 @@ DeviceActiveDirectoryPolicyStatusProvider:: DeviceActiveDirectoryPolicyStatusProvider( policy::DeviceActiveDirectoryPolicyManager* manager) - : store_(manager->store()) {} + : store_(manager->store()) { + store_->AddObserver(this); +} DeviceActiveDirectoryPolicyStatusProvider:: - ~DeviceActiveDirectoryPolicyStatusProvider() {} + ~DeviceActiveDirectoryPolicyStatusProvider() { + store_->RemoveObserver(this); +} // TODO(tnagel): Provide more details and/or remove unused fields from UI. See // https://crbug.com/664747. @@ -451,6 +461,16 @@ dict->SetString("status", status); } +void DeviceActiveDirectoryPolicyStatusProvider::OnStoreLoaded( + policy::CloudPolicyStore* store) { + NotifyStatusChange(); +} + +void DeviceActiveDirectoryPolicyStatusProvider::OnStoreError( + policy::CloudPolicyStore* store) { + NotifyStatusChange(); +} + #endif // defined(OS_CHROMEOS) PolicyUIHandler::PolicyUIHandler()
diff --git a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc index 01b5876..1e6f110 100644 --- a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc +++ b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
@@ -120,12 +120,14 @@ void UnlockProfileAndHideLoginUI(const base::FilePath profile_path, InlineLoginHandlerImpl* handler) { - ProfileManager* profile_manager = g_browser_process->profile_manager(); - if (profile_manager) { - ProfileAttributesEntry* entry; - if (profile_manager->GetProfileAttributesStorage() - .GetProfileAttributesWithPath(profile_path, &entry)) { - entry->SetIsSigninRequired(false); + if (!profile_path.empty()) { + ProfileManager* profile_manager = g_browser_process->profile_manager(); + if (profile_manager) { + ProfileAttributesEntry* entry; + if (profile_manager->GetProfileAttributesStorage() + .GetProfileAttributesWithPath(profile_path, &entry)) { + entry->SetIsSigninRequired(false); + } } } if (handler) @@ -796,7 +798,7 @@ // If opened from user manager to unlock a profile, make sure the user manager // is closed and that the profile is marked as unlocked. - if (!params.profile_path.empty() && !signin::IsForceSigninEnabled()) { + if (!signin::IsForceSigninEnabled()) { UnlockProfileAndHideLoginUI(params.profile_path, params.handler); } }
diff --git a/chrome/renderer/extensions/extension_localization_peer.cc b/chrome/renderer/extensions/extension_localization_peer.cc index 745aabe..7f16703 100644 --- a/chrome/renderer/extensions/extension_localization_peer.cc +++ b/chrome/renderer/extensions/extension_localization_peer.cc
@@ -27,9 +27,6 @@ const char* payload() const override { return data_.data(); } int length() const override { return data_.size(); } int encoded_data_length() const override { return -1; } - // The original data has substitutions applied, so the original - // encoded_body_length no longer applies. - int encoded_body_length() const override { return data_.size(); } private: const std::string data_; @@ -94,14 +91,15 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) { + int64_t total_transfer_size, + int64_t encoded_body_size) { // Give sub-classes a chance at altering the data. if (error_code != net::OK) { // We failed to load the resource. original_peer_->OnReceivedResponse(response_info_); original_peer_->OnCompletedRequest(net::ERR_ABORTED, false, stale_copy_in_cache, completion_time, - total_transfer_size); + total_transfer_size, encoded_body_size); return; } @@ -112,7 +110,7 @@ original_peer_->OnReceivedData(base::MakeUnique<StringData>(data_)); original_peer_->OnCompletedRequest(error_code, was_ignored_by_handler, stale_copy_in_cache, completion_time, - total_transfer_size); + total_transfer_size, encoded_body_size); } void ExtensionLocalizationPeer::ReplaceMessages() {
diff --git a/chrome/renderer/extensions/extension_localization_peer.h b/chrome/renderer/extensions/extension_localization_peer.h index b7b0e60..d7544dad8 100644 --- a/chrome/renderer/extensions/extension_localization_peer.h +++ b/chrome/renderer/extensions/extension_localization_peer.h
@@ -46,7 +46,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) override; + int64_t total_transfer_size, + int64_t encoded_body_size) override; private: friend class ExtensionLocalizationPeerTest;
diff --git a/chrome/renderer/extensions/extension_localization_peer_unittest.cc b/chrome/renderer/extensions/extension_localization_peer_unittest.cc index 587f0020f..d7f59b5 100644 --- a/chrome/renderer/extensions/extension_localization_peer_unittest.cc +++ b/chrome/renderer/extensions/extension_localization_peer_unittest.cc
@@ -79,12 +79,13 @@ void(const char* data, int data_length, int encoded_data_length)); - MOCK_METHOD5(OnCompletedRequest, + MOCK_METHOD6(OnCompletedRequest, void(int error_code, bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size)); + int64_t total_transfer_size, + int64_t encoded_body_size)); private: DISALLOW_COPY_AND_ASSIGN(MockRequestPeer); @@ -138,12 +139,12 @@ const std::string data_chunk("12345"); filter_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>( - data_chunk.data(), data_chunk.length(), -1, 0)); + data_chunk.data(), data_chunk.length(), -1)); EXPECT_EQ(data_chunk, GetData()); filter_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>( - data_chunk.data(), data_chunk.length(), -1, 0)); + data_chunk.data(), data_chunk.length(), -1)); EXPECT_EQ(data_chunk + data_chunk, GetData()); } @@ -155,10 +156,10 @@ EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); EXPECT_CALL(*original_peer_, OnCompletedRequest(net::ERR_ABORTED, false, false, - base::TimeTicks(), -1)); + base::TimeTicks(), -1, 0)); filter_peer_->OnCompletedRequest(net::ERR_FAILED, false, false, - base::TimeTicks(), -1); + base::TimeTicks(), -1, 0); } TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestEmptyData) { @@ -168,11 +169,11 @@ EXPECT_CALL(*sender_, Send(_)).Times(0); EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); - EXPECT_CALL(*original_peer_, - OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1)); + EXPECT_CALL(*original_peer_, OnCompletedRequest(net::OK, false, false, + base::TimeTicks(), -1, 0)); - filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), - -1); + filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1, + 0); } TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestNoCatalogs) { @@ -187,11 +188,11 @@ EXPECT_CALL(*original_peer_, OnReceivedDataInternal(StrEq(data.c_str()), data.length(), -1)) .Times(1); - EXPECT_CALL(*original_peer_, - OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1)) + EXPECT_CALL(*original_peer_, OnCompletedRequest(net::OK, false, false, + base::TimeTicks(), -1, -1)) .Times(1); - filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), + filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1, -1); // Test if Send gets called again (it shouldn't be) when first call returned @@ -201,11 +202,11 @@ EXPECT_CALL(*original_peer_, OnReceivedDataInternal(StrEq(data.c_str()), data.length(), -1)) .Times(1); - EXPECT_CALL(*original_peer_, - OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1)) + EXPECT_CALL(*original_peer_, OnCompletedRequest(net::OK, false, false, + base::TimeTicks(), -1, -1)) .Times(1); SetData("some text"); - filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), + filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1, -1); } @@ -229,10 +230,10 @@ EXPECT_CALL(*original_peer_, OnReceivedDataInternal(StrEq(data.c_str()), data.length(), -1)); - EXPECT_CALL(*original_peer_, - OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1)); + EXPECT_CALL(*original_peer_, OnCompletedRequest(net::OK, false, false, + base::TimeTicks(), -1, -1)); - filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), + filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1, -1); } @@ -256,9 +257,9 @@ EXPECT_CALL(*original_peer_, OnReceivedDataInternal(StrEq(message.c_str()), message.length(), -1)); - EXPECT_CALL(*original_peer_, - OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1)); + EXPECT_CALL(*original_peer_, OnCompletedRequest(net::OK, false, false, + base::TimeTicks(), -1, 0)); - filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), - -1); + filter_peer_->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), -1, + 0); }
diff --git a/chrome/renderer/security_filter_peer.cc b/chrome/renderer/security_filter_peer.cc index bfbdfa17..318f8e5 100644 --- a/chrome/renderer/security_filter_peer.cc +++ b/chrome/renderer/security_filter_peer.cc
@@ -134,25 +134,26 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) { + int64_t total_transfer_size, + int64_t encoded_body_size) { // Give sub-classes a chance at altering the data. if (error_code != net::OK || !DataReady()) { // Pretend we failed to load the resource. original_peer_->OnReceivedResponse(response_info_); original_peer_->OnCompletedRequest(net::ERR_ABORTED, false, stale_copy_in_cache, completion_time, - total_transfer_size); + total_transfer_size, encoded_body_size); return; } original_peer_->OnReceivedResponse(response_info_); if (!data_.empty()) { original_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>( - data_.data(), data_.size(), -1, 0)); + data_.data(), data_.size(), -1)); } original_peer_->OnCompletedRequest(error_code, was_ignored_by_handler, stale_copy_in_cache, completion_time, - total_transfer_size); + total_transfer_size, encoded_body_size); } //////////////////////////////////////////////////////////////////////////////// @@ -181,15 +182,17 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) { + int64_t total_transfer_size, + int64_t encoded_body_size) { content::ResourceResponseInfo info; ProcessResponseInfo(info, &info, mime_type_); info.content_length = static_cast<int>(data_.size()); original_peer_->OnReceivedResponse(info); if (!data_.empty()) { original_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>( - data_.data(), data_.size(), -1, 0)); + data_.data(), data_.size(), -1)); } original_peer_->OnCompletedRequest(net::OK, false, stale_copy_in_cache, - completion_time, total_transfer_size); + completion_time, total_transfer_size, + encoded_body_size); }
diff --git a/chrome/renderer/security_filter_peer.h b/chrome/renderer/security_filter_peer.h index 1eea5ff8..e0d8e6500 100644 --- a/chrome/renderer/security_filter_peer.h +++ b/chrome/renderer/security_filter_peer.h
@@ -64,7 +64,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) override; + int64_t total_transfer_size, + int64_t encoded_body_size) override; protected: // Invoked when the entire request has been processed before the data is sent @@ -102,7 +103,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) override; + int64_t total_transfer_size, + int64_t encoded_body_size) override; private: content::ResourceResponseInfo response_info_;
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 6b3d5d5..2770e8d 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -398,6 +398,7 @@ "../browser/password_manager/password_manager_interactive_uitest.cc", "../browser/renderer_context_menu/render_view_context_menu_browsertest_util.cc", "../browser/renderer_context_menu/render_view_context_menu_browsertest_util.h", + "../browser/renderer_host/site_per_process_text_input_browsertest.cc", "../browser/site_per_process_interactive_browsertest.cc", "../browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc", "../browser/ui/blocked_content/popup_blocker_browsertest.cc", @@ -607,10 +608,6 @@ [ "//ui/views/widget/native_widget_aura_interactive_uitest.cc" ] } if (use_aura || is_mac) { - # TODO(ekaramad): These tests are activated for aura and mac only. They - # should be moved to 'interactive_ui_tests' sources for all platforms - # once https://crbug.com/578168 is fixed. - sources += [ "//chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc" ] deps += [ "//ui/touch_selection" ] } } @@ -2047,8 +2044,6 @@ "../browser/apps/app_browsertest_util.h", "../browser/extensions/browsertest_util.cc", "../browser/extensions/browsertest_util.h", - "../browser/extensions/chrome_extension_test_notification_observer.cc", - "../browser/extensions/chrome_extension_test_notification_observer.h", "../browser/extensions/extension_apitest.cc", "../browser/extensions/extension_apitest.h", "../browser/extensions/extension_browsertest.cc",
diff --git a/chrome/test/chromedriver/capabilities.cc b/chrome/test/chromedriver/capabilities.cc index 75d021b..60ad11cd 100644 --- a/chrome/test/chromedriver/capabilities.cc +++ b/chrome/test/chromedriver/capabilities.cc
@@ -23,6 +23,7 @@ #include "chrome/test/chromedriver/chrome/page_load_strategy.h" #include "chrome/test/chromedriver/chrome/status.h" #include "chrome/test/chromedriver/logging.h" +#include "chrome/test/chromedriver/session.h" namespace { @@ -190,6 +191,17 @@ return Status(kUnknownError, "page load strategy unsupported"); } +Status ParseUnexpectedAlertBehaviour(const base::Value& option, + Capabilities* capabilities) { + if (!option.GetAsString(&capabilities->unexpected_alert_behaviour)) + return Status(kUnknownError, "must be a string"); + if (capabilities->unexpected_alert_behaviour == kAccept || + capabilities->unexpected_alert_behaviour == kDismiss || + capabilities->unexpected_alert_behaviour == kIgnore) + return Status(kOk); + return Status(kUnknownError, "unexpected alert behaviour unsupported"); +} + Status ParseSwitches(const base::Value& option, Capabilities* capabilities) { const base::ListValue* switches_list = NULL; @@ -620,6 +632,8 @@ parser_map["loggingPrefs"] = base::Bind(&ParseLoggingPrefs); parser_map["proxy"] = base::Bind(&ParseProxy); parser_map["pageLoadStrategy"] = base::Bind(&ParsePageLoadStrategy); + parser_map["unexpectedAlertBehaviour"] = + base::Bind(&ParseUnexpectedAlertBehaviour); // Network emulation requires device mode, which is only enabled when // mobile emulation is on. if (desired_caps.GetDictionary("chromeOptions.mobileEmulation", nullptr)) {
diff --git a/chrome/test/chromedriver/capabilities.h b/chrome/test/chromedriver/capabilities.h index 49a3a72..22ede2b 100644 --- a/chrome/test/chromedriver/capabilities.h +++ b/chrome/test/chromedriver/capabilities.h
@@ -144,6 +144,8 @@ std::string page_load_strategy; + std::string unexpected_alert_behaviour; + bool network_emulation_enabled; PerfLoggingPrefs perf_logging_prefs;
diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc index 1312d01..41b24ac 100644 --- a/chrome/test/chromedriver/chrome_launcher.cc +++ b/chrome/test/chromedriver/chrome_launcher.cc
@@ -371,7 +371,7 @@ } #elif defined(OS_WIN) if (!SwitchToUSKeyboardLayout()) - VLOG(0) << "Can not set to US keyboard layout - Some keycodes may be" + VLOG(0) << "Cannot switch to US keyboard layout - some keys may be " "interpreted incorrectly"; #endif
diff --git a/chrome/test/chromedriver/client/chromedriver.py b/chrome/test/chromedriver/client/chromedriver.py index 7c075f00..b90a59a7 100644 --- a/chrome/test/chromedriver/client/chromedriver.py +++ b/chrome/test/chromedriver/client/chromedriver.py
@@ -111,7 +111,7 @@ mobile_emulation=None, experimental_options=None, download_dir=None, network_connection=None, send_w3c_capability=None, send_w3c_request=None, - page_load_strategy=None): + page_load_strategy=None, unexpected_alert_behaviour=None): self._executor = command_executor.CommandExecutor(server_url) options = {} @@ -190,6 +190,11 @@ assert type(page_load_strategy) is str params['desiredCapabilities']['pageLoadStrategy'] = page_load_strategy + if unexpected_alert_behaviour: + assert type(unexpected_alert_behaviour) is str + params['desiredCapabilities']['unexpectedAlertBehaviour'] = ( + unexpected_alert_behaviour) + if network_connection: params['desiredCapabilities']['networkConnectionEnabled'] = ( network_connection)
diff --git a/chrome/test/chromedriver/session.h b/chrome/test/chromedriver/session.h index b582212..c7c288d 100644 --- a/chrome/test/chromedriver/session.h +++ b/chrome/test/chromedriver/session.h
@@ -18,6 +18,10 @@ #include "chrome/test/chromedriver/chrome/network_conditions.h" #include "chrome/test/chromedriver/command_listener.h" +static const char kAccept[] = "accept"; +static const char kDismiss[] = "dismiss"; +static const char kIgnore[] = "ignore"; + namespace base { class DictionaryValue; } @@ -86,6 +90,7 @@ // |CommandListener|s might be |CommandListenerProxy|s that forward to // |DevToolsEventListener|s owned by |chrome|. ScopedVector<CommandListener> command_listeners; + std::string unexpected_alert_behaviour; }; Session* GetThreadLocalSession();
diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc index 577bbe7..8f135fd 100644 --- a/chrome/test/chromedriver/session_commands.cc +++ b/chrome/test/chromedriver/session_commands.cc
@@ -104,13 +104,14 @@ namespace { -std::unique_ptr<base::DictionaryValue> CreateCapabilities(Chrome* chrome) { +std::unique_ptr<base::DictionaryValue> CreateCapabilities(Session* session) { std::unique_ptr<base::DictionaryValue> caps(new base::DictionaryValue()); caps->SetString("browserName", "chrome"); - caps->SetString("version", chrome->GetBrowserInfo()->browser_version); + caps->SetString("version", + session->chrome->GetBrowserInfo()->browser_version); caps->SetString("chrome.chromedriverVersion", kChromeDriverVersion); - caps->SetString("platform", chrome->GetOperatingSystemName()); - caps->SetString("pageLoadStrategy", chrome->page_load_strategy()); + caps->SetString("platform", session->chrome->GetOperatingSystemName()); + caps->SetString("pageLoadStrategy", session->chrome->page_load_strategy()); caps->SetBoolean("javascriptEnabled", true); caps->SetBoolean("takesScreenshot", true); caps->SetBoolean("takesHeapSnapshot", true); @@ -118,7 +119,7 @@ caps->SetBoolean("databaseEnabled", false); caps->SetBoolean("locationContextEnabled", true); caps->SetBoolean("mobileEmulationEnabled", - chrome->IsMobileEmulationEnabled()); + session->chrome->IsMobileEmulationEnabled()); caps->SetBoolean("applicationCacheEnabled", false); caps->SetBoolean("browserConnectionEnabled", false); caps->SetBoolean("cssSelectorsEnabled", true); @@ -126,10 +127,12 @@ caps->SetBoolean("rotatable", false); caps->SetBoolean("acceptSslCerts", true); caps->SetBoolean("nativeEvents", true); - caps->SetBoolean("hasTouchScreen", chrome->HasTouchScreen()); + caps->SetBoolean("hasTouchScreen", session->chrome->HasTouchScreen()); + caps->SetString("unexpectedAlertBehaviour", + session->unexpected_alert_behaviour); ChromeDesktopImpl* desktop = NULL; - Status status = chrome->GetAsDesktop(&desktop); + Status status = session->chrome->GetAsDesktop(&desktop); if (status.IsOk()) { caps->SetString("chrome.userDataDir", desktop->command().GetSwitchValueNative("user-data-dir")); @@ -187,6 +190,9 @@ if (status.IsError()) return status; + desired_caps->GetString("unexpectedAlertBehaviour", + &session->unexpected_alert_behaviour); + Log::Level driver_level = Log::kWarning; if (capabilities.logging_prefs.count(WebDriverLog::kDriverType)) driver_level = capabilities.logging_prefs[WebDriverLog::kDriverType]; @@ -225,7 +231,7 @@ session->detach = capabilities.detach; session->force_devtools_screenshot = capabilities.force_devtools_screenshot; - session->capabilities = CreateCapabilities(session->chrome.get()); + session->capabilities = CreateCapabilities(session); value->reset(session->capabilities->DeepCopy()); return CheckSessionCreated(session); }
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py index 2f560b5..af4cf9c 100755 --- a/chrome/test/chromedriver/test/run_py_tests.py +++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -202,6 +202,7 @@ 'testHistoryNavigationWithPageLoadTimeout', # Webview shell doesn't support Alerts. 'ChromeDriverTest.testAlert', + 'ChromeDesiredCapabilityTest.testUnexpectedAlertBehaviour', ] ) @@ -1657,6 +1658,7 @@ download = prefs['download'] self.assertEqual(download['default_directory'], download_dir) + class ChromeSwitchesCapabilityTest(ChromeDriverBaseTest): """Tests that chromedriver properly processes chromeOptions.args capabilities. @@ -1675,6 +1677,21 @@ driver.ExecuteScript('return window.domAutomationController')) +class ChromeDesiredCapabilityTest(ChromeDriverBaseTest): + """Tests that chromedriver properly processes desired capabilities.""" + + def testUnexpectedAlertBehaviour(self): + driver = self.CreateDriver(unexpected_alert_behaviour="accept") + self.assertEquals("accept", + driver.capabilities['unexpectedAlertBehaviour']) + driver.ExecuteScript('alert("HI");') + self.WaitForCondition(driver.IsAlertOpen) + self.assertRaisesRegexp(chromedriver.UnexpectedAlertOpen, + 'unexpected alert open: {Alert text : HI}', + driver.FindElement, 'tag name', 'div') + self.assertFalse(driver.IsAlertOpen()) + + class ChromeExtensionsCapabilityTest(ChromeDriverBaseTest): """Tests that chromedriver properly processes chromeOptions.extensions.""" @@ -2185,6 +2202,7 @@ response = driver2.GetSessions() self.assertEqual(2, len(response)) + class RemoteBrowserTest(ChromeDriverBaseTest): """Tests for ChromeDriver remote browser capability.""" def setUp(self): @@ -2220,6 +2238,7 @@ return port raise RuntimeError('Cannot find open port') + class PerfTest(ChromeDriverBaseTest): """Tests for ChromeDriver perf.""" def setUp(self):
diff --git a/chrome/test/chromedriver/test/test_expectations b/chrome/test/chromedriver/test/test_expectations index acc7a1b..6dc75ca 100644 --- a/chrome/test/chromedriver/test/test_expectations +++ b/chrome/test/chromedriver/test/test_expectations
@@ -75,7 +75,8 @@ 'TypingTest.testShouldBeAbleToTypeIntoContentEditableElementWithExistingValue', 'TypingTest.testShouldNotTypeIntoElementsThatPreventKeyDownEvents', 'TypingTest.testTypingIntoAnIFrameWithContentEditableOrDesignModeSet', - 'UnexpectedAlertBehaviorTest.*', + 'UnexpectedAlertBehaviorTest.requiredUnhandledAlertCapabilityHasPriorityOverDesired', + 'UnexpectedAlertBehaviorTest.dismissUnhandledAlertsByDefault', 'VisibilityTest.testElementHiddenByOverflowXIsNotVisible', 'VisibilityTest.testElementHiddenByOverflowYIsNotVisible', 'VisibilityTest.tooSmallAWindowWithOverflowHiddenIsNotAProblem', @@ -176,6 +177,7 @@ # Alerts are not yet supported on Android. 'AlertsTest.*', + 'UnexpectedAlertBehaviorTest.*', # http://crbug.com/156390 'DragAndDropTest.*',
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc index ac2598a..023487d 100644 --- a/chrome/test/chromedriver/window_commands.cc +++ b/chrome/test/chromedriver/window_commands.cc
@@ -218,12 +218,24 @@ if (status.IsError()) return status; - if (web_view->GetJavaScriptDialogManager()->IsDialogOpen()) { + JavaScriptDialogManager* dialog_manager = + web_view->GetJavaScriptDialogManager(); + if (dialog_manager->IsDialogOpen()) { std::string alert_text; - status = - web_view->GetJavaScriptDialogManager()->GetDialogMessage(&alert_text); + status = dialog_manager->GetDialogMessage(&alert_text); if (status.IsError()) return status; + + // Close the dialog depending on the unexpectedalert behaviour set by user + // before returning an error, so that subsequent commands do not fail. + std::string alert_behaviour = session->unexpected_alert_behaviour; + if (alert_behaviour == kAccept) + status = dialog_manager->HandleDialog(true, session->prompt_text.get()); + else if (alert_behaviour == kDismiss) + status = dialog_manager->HandleDialog(false, session->prompt_text.get()); + if (status.IsError()) + return status; + return Status(kUnexpectedAlertOpen, "{Alert text : " + alert_text + "}"); }
diff --git a/chromecast/browser/cast_memory_pressure_monitor.cc b/chromecast/browser/cast_memory_pressure_monitor.cc index b5bc6d21..e07804c 100644 --- a/chromecast/browser/cast_memory_pressure_monitor.cc +++ b/chromecast/browser/cast_memory_pressure_monitor.cc
@@ -55,7 +55,7 @@ CastMemoryPressureMonitor::~CastMemoryPressureMonitor() {} CastMemoryPressureMonitor::MemoryPressureLevel -CastMemoryPressureMonitor::GetCurrentPressureLevel() const { +CastMemoryPressureMonitor::GetCurrentPressureLevel() { return current_level_; }
diff --git a/chromecast/browser/cast_memory_pressure_monitor.h b/chromecast/browser/cast_memory_pressure_monitor.h index bb6ed92..9d45cbf2 100644 --- a/chromecast/browser/cast_memory_pressure_monitor.h +++ b/chromecast/browser/cast_memory_pressure_monitor.h
@@ -21,7 +21,7 @@ ~CastMemoryPressureMonitor() override; // base::MemoryPressureMonitor implementation: - MemoryPressureLevel GetCurrentPressureLevel() const override; + MemoryPressureLevel GetCurrentPressureLevel() override; void SetDispatchCallback(const DispatchCallback& callback) override; private:
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index b1c9ceb8..dd0097e 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -3667,12 +3667,25 @@ } // Tests that credit card data are saved for forms on https -TEST_F(AutofillManagerTest, ImportFormDataCreditCardHTTPS) { +// TODO(crbug.com/666704): Flaky on android_n5x_swarming_rel bot. +#if defined(OS_ANDROID) +#define MAYBE_ImportFormDataCreditCardHTTPS \ + DISABLED_ImportFormDataCreditCardHTTPS +#else +#define MAYBE_ImportFormDataCreditCardHTTPS ImportFormDataCreditCardHTTPS +#endif +TEST_F(AutofillManagerTest, MAYBE_ImportFormDataCreditCardHTTPS) { TestSaveCreditCards(true); } // Tests that credit card data are saved for forms on http -TEST_F(AutofillManagerTest, ImportFormDataCreditCardHTTP) { +// TODO(crbug.com/666704): Flaky on android_n5x_swarming_rel bot. +#if defined(OS_ANDROID) +#define MAYBE_ImportFormDataCreditCardHTTP DISABLED_ImportFormDataCreditCardHTTP +#else +#define MAYBE_ImportFormDataCreditCardHTTP ImportFormDataCreditCardHTTP +#endif +TEST_F(AutofillManagerTest, MAYBE_ImportFormDataCreditCardHTTP) { TestSaveCreditCards(false); }
diff --git a/components/components_google_chrome_strings.grd b/components/components_google_chrome_strings.grd index d4f3b0f5..256a044 100644 --- a/components/components_google_chrome_strings.grd +++ b/components/components_google_chrome_strings.grd
@@ -188,12 +188,12 @@ <!-- About Flags UI --> <if expr="not chromeos"> - <message name="IDS_FLAGS_UI_RELAUNCH_NOTICE" desc="Notifies the user that he needs to relaunch Chrome. Shown next to a button that says 'Relaunch Now'."> + <message name="IDS_FLAGS_UI_RELAUNCH_NOTICE" desc="Notifies the user that they need to relaunch Chrome. Shown next to a button that says 'Relaunch Now'."> Your changes will take effect the next time you relaunch Google Chrome. </message> </if> <if expr="chromeos"> - <message name="IDS_FLAGS_UI_RELAUNCH_NOTICE" desc="Notifies the user that he needs to restart Chrome OS. Shown next to a button that says 'Restart Now'."> + <message name="IDS_FLAGS_UI_RELAUNCH_NOTICE" desc="Notifies the user that they need to restart Chrome OS. Shown next to a button that says 'Restart Now'."> Your changes will take effect the next time you restart your device. </message> </if>
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc index b5db52bd..9f616f4b 100644 --- a/components/content_settings/core/browser/cookie_settings.cc +++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -58,18 +58,36 @@ bool CookieSettings::IsReadingCookieAllowed(const GURL& url, const GURL& first_party_url) const { - ContentSetting setting = GetCookieSetting(url, first_party_url, false, NULL); - return IsAllowed(setting); + ContentSetting reading_setting; + GetCookieSetting(url, first_party_url, nullptr, &reading_setting, + nullptr /* setting_cookie */); + return IsAllowed(reading_setting); } bool CookieSettings::IsSettingCookieAllowed(const GURL& url, const GURL& first_party_url) const { - ContentSetting setting = GetCookieSetting(url, first_party_url, true, NULL); - return IsAllowed(setting); + ContentSetting setting_setting; + GetCookieSetting(url, first_party_url, nullptr, nullptr /* reading_cookie */, + &setting_setting); + return IsAllowed(setting_setting); +} + +void CookieSettings::GetReadingAndSettingCookieAllowed( + const GURL& url, + const GURL& first_party_url, + bool* reading_cookie_allowed, + bool* setting_cookie_allowed) const { + ContentSetting reading_setting; + ContentSetting setting_setting; + GetCookieSetting(url, first_party_url, nullptr, &reading_setting, + &setting_setting); + *reading_cookie_allowed = IsAllowed(reading_setting); + *setting_cookie_allowed = IsAllowed(setting_setting); } bool CookieSettings::IsCookieSessionOnly(const GURL& origin) const { - ContentSetting setting = GetCookieSetting(origin, origin, true, NULL); + ContentSetting setting; + GetCookieSetting(origin, origin, nullptr, nullptr, &setting); DCHECK(IsValidSetting(setting)); return (setting == CONTENT_SETTING_SESSION_ONLY); } @@ -122,18 +140,29 @@ pref_change_registrar_.RemoveAll(); } -ContentSetting CookieSettings::GetCookieSetting(const GURL& url, - const GURL& first_party_url, - bool setting_cookie, - SettingSource* source) const { +void CookieSettings::GetCookieSetting(const GURL& url, + const GURL& first_party_url, + content_settings::SettingSource* source, + ContentSetting* reading_cookie, + ContentSetting* setting_cookie) const { // Auto-allow in extensions or for WebUI embedded in a secure origin. - if (url.SchemeIsCryptographic() && first_party_url.SchemeIs(kChromeUIScheme)) - return CONTENT_SETTING_ALLOW; + if (first_party_url.SchemeIs(kChromeUIScheme) && + url.SchemeIsCryptographic()) { + if (reading_cookie) + *reading_cookie = CONTENT_SETTING_ALLOW; + if (setting_cookie) + *setting_cookie = CONTENT_SETTING_ALLOW; + return; + } #if BUILDFLAG(ENABLE_EXTENSIONS) - if (url.SchemeIs(kExtensionScheme) && - first_party_url.SchemeIs(kExtensionScheme)) { - return CONTENT_SETTING_ALLOW; + if (url.SchemeIs(extension_scheme_) && + first_party_url.SchemeIs(extension_scheme_)) { + if (reading_cookie) + *reading_cookie = CONTENT_SETTING_ALLOW; + if (setting_cookie) + *setting_cookie = CONTENT_SETTING_ALLOW; + return; } #endif @@ -147,26 +176,27 @@ *source = info.source; // If no explicit exception has been made and third-party cookies are blocked - // by default, apply that rule. - if (info.primary_pattern.MatchesAllHosts() && - info.secondary_pattern.MatchesAllHosts() && - ShouldBlockThirdPartyCookies() && - !first_party_url.SchemeIs(extension_scheme_)) { - net::StaticCookiePolicy policy( - net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES); - int rv; - if (setting_cookie) - rv = policy.CanSetCookie(url, first_party_url); - else - rv = policy.CanGetCookies(url, first_party_url); - DCHECK_NE(net::ERR_IO_PENDING, rv); - if (rv != net::OK) - return CONTENT_SETTING_BLOCK; - } + // by default, apply CONTENT_SETTING_BLOCKED. + bool block_third = info.primary_pattern.MatchesAllHosts() && + info.secondary_pattern.MatchesAllHosts() && + ShouldBlockThirdPartyCookies() && + !first_party_url.SchemeIs(extension_scheme_); + net::StaticCookiePolicy policy( + net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES); // We should always have a value, at least from the default provider. DCHECK(value.get()); - return ValueToContentSetting(value.get()); + ContentSetting setting = ValueToContentSetting(value.get()); + if (reading_cookie) { + bool block = + block_third && policy.CanGetCookies(url, first_party_url) != net::OK; + *reading_cookie = block ? CONTENT_SETTING_BLOCK : setting; + } + if (setting_cookie) { + bool block = + block_third && policy.CanSetCookie(url, first_party_url) != net::OK; + *setting_cookie = block ? CONTENT_SETTING_BLOCK : setting; + } } CookieSettings::~CookieSettings() {
diff --git a/components/content_settings/core/browser/cookie_settings.h b/components/content_settings/core/browser/cookie_settings.h index efb7598..b1653f37 100644 --- a/components/content_settings/core/browser/cookie_settings.h +++ b/components/content_settings/core/browser/cookie_settings.h
@@ -36,7 +36,7 @@ // Returns the default content setting (CONTENT_SETTING_ALLOW, // CONTENT_SETTING_BLOCK, or CONTENT_SETTING_SESSION_ONLY) for cookies. If - // |provider_id| is not NULL, the id of the provider which provided the + // |provider_id| is not nullptr, the id of the provider which provided the // default setting is assigned to it. // // This may be called on any thread. @@ -56,6 +56,15 @@ bool IsSettingCookieAllowed(const GURL& url, const GURL& first_party_url) const; + // Gets the results from IsReadingCookieAllowed and IsSettingCookieAllowed in + // a performance efficient way. + // + // This may be called on any thread. + void GetReadingAndSettingCookieAllowed(const GURL& url, + const GURL& first_party_url, + bool* reading_cookie_allowed, + bool* setting_cookie_allowed) const; + // Returns true if the cookie set by a page identified by |url| should be // session only. Querying this only makes sense if |IsSettingCookieAllowed| // has returned true. @@ -65,7 +74,7 @@ // Returns all patterns with a non-default cookie setting, mapped to their // actual settings, in the precedence order of the setting rules. |settings| - // must be a non-NULL outparam. + // must be a non-nullptr outparam. // // This may be called on any thread. void GetCookieSettings(ContentSettingsForOneType* settings) const; @@ -94,11 +103,11 @@ void ShutdownOnUIThread() override; // A helper for applying third party cookie blocking rules. - ContentSetting GetCookieSetting( - const GURL& url, - const GURL& first_party_url, - bool setting_cookie, - content_settings::SettingSource* source) const; + void GetCookieSetting(const GURL& url, + const GURL& first_party_url, + content_settings::SettingSource* source, + ContentSetting* reading_cookie, + ContentSetting* setting_cookie) const; static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java index 24ba0fe..9acfb99 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
@@ -545,8 +545,7 @@ Context context = getContext(); File directory = new File(PathUtils.getDataDirectory()); File file = File.createTempFile("cronet", "json", directory); - CronetEngine cronetEngine = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + CronetEngine cronetEngine = new CronetEngine.Builder(context).build(); // Start NetLog immediately after the request context is created to make // sure that the call won't crash the app even when the native request // context is not fully initialized. See crbug.com/470196. @@ -576,8 +575,8 @@ assertFalse(netLogDir.exists()); assertTrue(netLogDir.mkdir()); File eventFile = new File(netLogDir, "event_file_0.json"); - CronetUrlRequestContext cronetEngine = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + ExperimentalCronetEngine cronetEngine = + new ExperimentalCronetEngine.Builder(context).build(); // Start NetLog immediately after the request context is created to make // sure that the call won't crash the app even when the native request // context is not fully initialized. See crbug.com/470196. @@ -606,8 +605,7 @@ Context context = getContext(); File directory = new File(PathUtils.getDataDirectory()); File file = File.createTempFile("cronet", "json", directory); - CronetUrlRequestContext cronetEngine = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + CronetEngine cronetEngine = new CronetEngine.Builder(context).build(); cronetEngine.startNetLogToFile(file.getPath(), false); // Start a request. @@ -637,8 +635,8 @@ assertFalse(netLogDir.exists()); assertTrue(netLogDir.mkdir()); File eventFile = new File(netLogDir, "event_file_0.json"); - CronetUrlRequestContext cronetEngine = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + ExperimentalCronetEngine cronetEngine = + new ExperimentalCronetEngine.Builder(context).build(); cronetEngine.startNetLogToDisk(netLogDir.getPath(), false, MAX_FILE_SIZE); // Start a request. @@ -665,10 +663,8 @@ File directory = new File(PathUtils.getDataDirectory()); File file1 = File.createTempFile("cronet1", "json", directory); File file2 = File.createTempFile("cronet2", "json", directory); - CronetEngine cronetEngine1 = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); - CronetEngine cronetEngine2 = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + CronetEngine cronetEngine1 = new CronetEngine.Builder(context).build(); + CronetEngine cronetEngine2 = new CronetEngine.Builder(context).build(); cronetEngine1.startNetLogToFile(file1.getPath(), false); cronetEngine2.startNetLogToFile(file2.getPath(), false); @@ -714,10 +710,10 @@ File eventFile1 = new File(netLogDir1, "event_file_0.json"); File eventFile2 = new File(netLogDir2, "event_file_0.json"); - CronetUrlRequestContext cronetEngine1 = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); - CronetUrlRequestContext cronetEngine2 = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + ExperimentalCronetEngine cronetEngine1 = + new ExperimentalCronetEngine.Builder(context).build(); + ExperimentalCronetEngine cronetEngine2 = + new ExperimentalCronetEngine.Builder(context).build(); cronetEngine1.startNetLogToDisk(netLogDir1.getPath(), false, MAX_FILE_SIZE); cronetEngine2.startNetLogToDisk(netLogDir2.getPath(), false, MAX_FILE_SIZE); @@ -1027,8 +1023,7 @@ Context context = getContext(); File directory = new File(PathUtils.getDataDirectory()); File file = File.createTempFile("cronet", "json", directory); - CronetEngine cronetEngine = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + CronetEngine cronetEngine = new CronetEngine.Builder(context).build(); // Start NetLog with logAll as true. cronetEngine.startNetLogToFile(file.getPath(), true); // Start a request. @@ -1055,8 +1050,8 @@ assertFalse(netLogDir.exists()); assertTrue(netLogDir.mkdir()); File eventFile = new File(netLogDir, "event_file_0.json"); - CronetUrlRequestContext cronetEngine = - new CronetUrlRequestContext(new CronetEngineBuilderImpl(context)); + ExperimentalCronetEngine cronetEngine = + new ExperimentalCronetEngine.Builder(context).build(); // Start NetLog with logAll as true. cronetEngine.startNetLogToDisk(netLogDir.getPath(), true, MAX_FILE_SIZE); // Start a request. @@ -1342,16 +1337,11 @@ // Test that concurrently instantiating Cronet context's upon various // different versions of the same Android Context does not cause crashes // like crbug.com/453845 - final CronetTestFramework testFramework = startCronetTestFramework(); - CronetEngine firstEngine = - new CronetUrlRequestContext(CronetTestUtil.getCronetEngineBuilderImpl( - testFramework.createCronetEngineBuilder(getContext()))); - CronetEngine secondEngine = new CronetUrlRequestContext( - CronetTestUtil.getCronetEngineBuilderImpl(testFramework.createCronetEngineBuilder( - getContext().getApplicationContext()))); + CronetEngine firstEngine = new CronetEngine.Builder(getContext()).build(); + CronetEngine secondEngine = + new CronetEngine.Builder(getContext().getApplicationContext()).build(); CronetEngine thirdEngine = - new CronetUrlRequestContext(CronetTestUtil.getCronetEngineBuilderImpl( - testFramework.createCronetEngineBuilder(new ContextWrapper(getContext())))); + new CronetEngine.Builder(new ContextWrapper(getContext())).build(); firstEngine.shutdown(); secondEngine.shutdown(); thirdEngine.shutdown();
diff --git a/components/error_page_strings.grdp b/components/error_page_strings.grdp index c4d57340..89f9593 100644 --- a/components/error_page_strings.grdp +++ b/components/error_page_strings.grdp
@@ -303,10 +303,10 @@ <ph name="BEGIN_LINK"><a href="#buttons" onclick="toggleHelpBox()"></ph>Checking the proxy address<ph name="END_LINK"></a><ex></a></ex></ph> </message> </if> - <message name="IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMIN_SUMMARY" desc="The message displayed in a list of suggestions following a network error suggesting to the user to contact his system administrator. The suggestions list is prefixed with 'Try:'."> + <message name="IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMIN_SUMMARY" desc="The message displayed in a list of suggestions following a network error suggesting to the user to contact their system administrator. The suggestions list is prefixed with 'Try:'."> Contacting the system admin </message> - <message name="IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMIN_SUMMARY_STANDALONE" desc="Stand alone suggestion following a network error suggesting to the user to contact his system administrator."> + <message name="IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMIN_SUMMARY_STANDALONE" desc="Stand alone suggestion following a network error suggesting to the user to contact their system administrator."> Try contacting the system admin. </message> <message name="IDS_ERRORPAGES_SUGGESTION_LEARNMORE_SUMMARY" desc="The message displayed in a list of suggestions when a webpage fails to load. A link provided to the help center to learn more about the failure. The suggestions list is prefixed with 'Try:'.">
diff --git a/components/metrics/metrics_service.h b/components/metrics/metrics_service.h index 6d282bc..47095f70 100644 --- a/components/metrics/metrics_service.h +++ b/components/metrics/metrics_service.h
@@ -272,7 +272,7 @@ // call to this function. Also updates the cumulative uptime metric (stored // as a pref) for uninstall. Uptimes are measured using TimeTicks, which // guarantees that it is monotonic and does not jump if the user changes - // his/her clock. The TimeTicks implementation also makes the clock not + // their clock. The TimeTicks implementation also makes the clock not // count time the computer is suspended. void GetUptimes(PrefService* pref, base::TimeDelta* incremental_uptime,
diff --git a/components/policy/core/common/cloud/cloud_policy_constants.h b/components/policy/core/common/cloud/cloud_policy_constants.h index f6249ec9..d92d66a 100644 --- a/components/policy/core/common/cloud/cloud_policy_constants.h +++ b/components/policy/core/common/cloud/cloud_policy_constants.h
@@ -62,9 +62,12 @@ // The header used to transmit the policy ID for this client. POLICY_EXPORT extern const char kChromePolicyHeader[]; -// Information about the verification key used to verify that policy signing -// keys are valid. +// Public half of the verification key that is used to verify that policy +// signing keys are originating from DM server. Returns empty string in case +// policy key verification is disabled on the command line. POLICY_EXPORT std::string GetPolicyVerificationKey(); + +// Corresponding hash. POLICY_EXPORT extern const char kPolicyVerificationKeyHash[]; // Status codes for communication errors with the device management service.
diff --git a/components/policy/core/common/cloud/cloud_policy_validator.cc b/components/policy/core/common/cloud/cloud_policy_validator.cc index 2bcdbc6..d824ba23 100644 --- a/components/policy/core/common/cloud/cloud_policy_validator.cc +++ b/components/policy/core/common/cloud/cloud_policy_validator.cc
@@ -114,10 +114,9 @@ void CloudPolicyValidatorBase::ValidateCachedKey( const std::string& cached_key, const std::string& cached_key_signature, - const std::string& verification_key, const std::string& owning_domain) { validation_flags_ |= VALIDATE_CACHED_KEY; - set_verification_key_and_domain(verification_key, owning_domain); + set_owning_domain(owning_domain); cached_key_ = cached_key; cached_key_signature_ = cached_key_signature; } @@ -130,20 +129,18 @@ void CloudPolicyValidatorBase::ValidateSignatureAllowingRotation( const std::string& key, - const std::string& verification_key, const std::string& owning_domain) { validation_flags_ |= VALIDATE_SIGNATURE; DCHECK(key_.empty() || key_ == key); key_ = key; - set_verification_key_and_domain(verification_key, owning_domain); + set_owning_domain(owning_domain); allow_key_rotation_ = true; } void CloudPolicyValidatorBase::ValidateInitialKey( - const std::string& verification_key, const std::string& owning_domain) { validation_flags_ |= VALIDATE_INITIAL_KEY; - set_verification_key_and_domain(verification_key, owning_domain); + set_owning_domain(owning_domain); } void CloudPolicyValidatorBase::ValidateAgainstCurrentPolicy( @@ -181,6 +178,7 @@ dm_token_option_(DM_TOKEN_REQUIRED), device_id_option_(DEVICE_ID_REQUIRED), canonicalize_user_(false), + verification_key_(GetPolicyVerificationKey()), allow_key_rotation_(false), background_task_runner_(background_task_runner) {} @@ -271,8 +269,7 @@ // Verifies the |new_public_key_verification_signature_deprecated| for the // |new_public_key| in the policy blob. bool CloudPolicyValidatorBase::CheckNewPublicKeyVerificationSignature() { - // If there's no local verification key, then just return true (no - // validation possible). + // Skip verification if the key is empty (disabled via command line). if (verification_key_.empty()) { UMA_HISTOGRAM_ENUMERATION(kMetricPolicyKeyVerification, METRIC_POLICY_KEY_VERIFICATION_KEY_MISSING, @@ -344,12 +341,10 @@ return domain; } -void CloudPolicyValidatorBase::set_verification_key_and_domain( - const std::string& verification_key, const std::string& owning_domain) { - // Make sure we aren't overwriting the verification key with a different key. - DCHECK(verification_key_.empty() || verification_key_ == verification_key); +void CloudPolicyValidatorBase::set_owning_domain( + const std::string& owning_domain) { + // Make sure we aren't overwriting the owning domain with a different one. DCHECK(owning_domain_.empty() || owning_domain_ == owning_domain); - verification_key_ = verification_key; owning_domain_ = owning_domain; }
diff --git a/components/policy/core/common/cloud/cloud_policy_validator.h b/components/policy/core/common/cloud/cloud_policy_validator.h index 2342d7c..b56af89 100644 --- a/components/policy/core/common/cloud/cloud_policy_validator.h +++ b/components/policy/core/common/cloud/cloud_policy_validator.h
@@ -179,11 +179,10 @@ void ValidatePayload(); // Instruct the validator to check that |cached_key| is valid by verifying the - // |cached_key_signature| using the passed |owning_domain| and - // |verification_key|. + // |cached_key_signature| using the passed |owning_domain| and the baked-in + // policy verification key. void ValidateCachedKey(const std::string& cached_key, const std::string& cached_key_signature, - const std::string& verification_key, const std::string& owning_domain); // Instruct the validator to check that the signature on the policy blob @@ -194,21 +193,19 @@ // verifies against |key|. If there is a key rotation present in the policy // blob, this checks the signature on the new key against |key| and the policy // blob against the new key. New key is also validated using the passed - // |verification_key| and |owning_domain| against the proto's - // new_public_key_verification_signature_deprecated field. + // |owning_domain| and the baked-in policy verification key against the + // proto's new_public_key_verification_signature_deprecated field. void ValidateSignatureAllowingRotation(const std::string& key, - const std::string& verification_key, const std::string& owning_domain); // Similar to ValidateSignature(), this instructs the validator to check the // signature on the policy blob. However, this variant expects a new policy // key set in the policy blob and makes sure the policy is signed using that // key. This should be called at setup time when there is no existing policy - // key present to check against. New key is validated using the passed - // |verification_key| against the proto's + // key present to check against. New key is validated using the baked-in + // policy verification key against the proto's // new_public_key_verification_signature_deprecated field. - void ValidateInitialKey(const std::string& verification_key, - const std::string& owning_domain); + void ValidateInitialKey(const std::string& owning_domain); // Convenience helper that instructs the validator to check timestamp, DM // token and device id based on the current policy blob. |policy_data| may be @@ -275,7 +272,7 @@ void RunChecks(); // Helper routine that verifies that the new public key in the policy blob - // is properly signed by the |verification_key_|. + // is properly signed by the baked-in policy verification key. bool CheckNewPublicKeyVerificationSignature(); // Helper routine that performs a verification-key-based signature check, @@ -289,10 +286,9 @@ // empty string if the policy does not contain a username field. std::string ExtractDomainFromPolicy(); - // Sets the key and domain used to verify new public keys, and ensures that + // Sets the owning domain used to verify new public keys, and ensures that // callers don't try to set conflicting values. - void set_verification_key_and_domain(const std::string& verification_key, - const std::string& owning_domain); + void set_owning_domain(const std::string& owning_domain); // Helper functions implementing individual checks. Status CheckTimestamp();
diff --git a/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc b/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc index 23f4f5d..f5bf326d 100644 --- a/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc +++ b/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc
@@ -105,12 +105,10 @@ validator->ValidatePayload(); validator->ValidateCachedKey(public_key, cached_key_signature_, - GetPolicyVerificationKey(), owning_domain_); if (allow_key_rotation_) { - validator->ValidateSignatureAllowingRotation( - public_key, GetPolicyVerificationKey(), owning_domain_); - validator->ValidateInitialKey(GetPolicyVerificationKey(), owning_domain_); + validator->ValidateSignatureAllowingRotation(public_key, owning_domain_); + validator->ValidateInitialKey(owning_domain_); } else { validator->ValidateSignature(public_key); }
diff --git a/components/policy/core/common/cloud/mock_user_cloud_policy_store.cc b/components/policy/core/common/cloud/mock_user_cloud_policy_store.cc index a65a206..eeb6bb2 100644 --- a/components/policy/core/common/cloud/mock_user_cloud_policy_store.cc +++ b/components/policy/core/common/cloud/mock_user_cloud_policy_store.cc
@@ -9,7 +9,6 @@ MockUserCloudPolicyStore::MockUserCloudPolicyStore() : UserCloudPolicyStore(base::FilePath(), base::FilePath(), - std::string(), scoped_refptr<base::SequencedTaskRunner>()) {} MockUserCloudPolicyStore::~MockUserCloudPolicyStore() {}
diff --git a/components/policy/core/common/cloud/user_cloud_policy_store.cc b/components/policy/core/common/cloud/user_cloud_policy_store.cc index a6f862c1..9307530d 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_store.cc +++ b/components/policy/core/common/cloud/user_cloud_policy_store.cc
@@ -14,6 +14,7 @@ #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/task_runner_util.h" +#include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/proto/cloud_policy.pb.h" #include "components/policy/proto/device_management_backend.pb.h" #include "components/policy/proto/policy_signing_key.pb.h" @@ -137,7 +138,6 @@ void StorePolicyToDiskOnBackgroundThread( const base::FilePath& policy_path, const base::FilePath& key_path, - const std::string& verification_key, const em::PolicyFetchResponse& policy) { DVLOG(1) << "Storing policy to " << policy_path.value(); std::string data; @@ -155,7 +155,7 @@ key_info.set_signing_key(policy.new_public_key()); key_info.set_signing_key_signature( policy.new_public_key_verification_signature_deprecated()); - key_info.set_verification_key(verification_key); + key_info.set_verification_key(GetPolicyVerificationKey()); std::string key_data; if (!key_info.SerializeToString(&key_data)) { DLOG(WARNING) << "Failed to serialize policy signing key"; @@ -171,12 +171,10 @@ UserCloudPolicyStore::UserCloudPolicyStore( const base::FilePath& policy_path, const base::FilePath& key_path, - const std::string& verification_key, scoped_refptr<base::SequencedTaskRunner> background_task_runner) : UserCloudPolicyStoreBase(background_task_runner), policy_path_(policy_path), key_path_(key_path), - verification_key_(verification_key), weak_factory_(this) {} UserCloudPolicyStore::~UserCloudPolicyStore() {} @@ -184,14 +182,13 @@ // static std::unique_ptr<UserCloudPolicyStore> UserCloudPolicyStore::Create( const base::FilePath& profile_path, - const std::string& verification_key, scoped_refptr<base::SequencedTaskRunner> background_task_runner) { base::FilePath policy_path = profile_path.Append(kPolicyDir).Append(kPolicyCacheFile); base::FilePath key_path = profile_path.Append(kPolicyDir).Append(kKeyCacheFile); - return base::WrapUnique(new UserCloudPolicyStore( - policy_path, key_path, verification_key, background_task_runner)); + return base::WrapUnique( + new UserCloudPolicyStore(policy_path, key_path, background_task_runner)); } void UserCloudPolicyStore::SetSigninUsername(const std::string& username) { @@ -262,9 +259,8 @@ new em::PolicySigningKey(result.key)); bool doing_key_rotation = false; - const std::string& verification_key = verification_key_; if (!key->has_verification_key() || - key->verification_key() != verification_key_) { + key->verification_key() != GetPolicyVerificationKey()) { // The cached key didn't match our current key, so we're doing a key // rotation - make sure we request a new key from the server on our // next fetch. @@ -276,8 +272,7 @@ } Validate( - std::move(cloud_policy), std::move(key), verification_key, - validate_in_background, + std::move(cloud_policy), std::move(key), validate_in_background, base::Bind(&UserCloudPolicyStore::InstallLoadedPolicyAfterValidation, weak_factory_.GetWeakPtr(), doing_key_rotation, result.key.has_signing_key() ? result.key.signing_key() @@ -332,15 +327,13 @@ std::unique_ptr<em::PolicyFetchResponse> policy_copy( new em::PolicyFetchResponse(policy)); Validate(std::move(policy_copy), std::unique_ptr<em::PolicySigningKey>(), - verification_key_, true, - base::Bind(&UserCloudPolicyStore::StorePolicyAfterValidation, - weak_factory_.GetWeakPtr())); + true, base::Bind(&UserCloudPolicyStore::StorePolicyAfterValidation, + weak_factory_.GetWeakPtr())); } void UserCloudPolicyStore::Validate( std::unique_ptr<em::PolicyFetchResponse> policy, std::unique_ptr<em::PolicySigningKey> cached_key, - const std::string& verification_key, bool validate_in_background, const UserCloudPolicyValidator::CompletionCallback& callback) { // Configure the validator. @@ -393,7 +386,6 @@ validator->ValidateCachedKey(cached_key->signing_key(), cached_key->signing_key_signature(), - verification_key, owning_domain); // Loading from cache, so don't allow key rotation. validator->ValidateSignature(cached_key->signing_key()); @@ -404,14 +396,14 @@ // Case #3 - no valid existing policy key (either this is the initial // policy fetch, or we're doing a key rotation), so this new policy fetch // should include an initial key provision. - validator->ValidateInitialKey(verification_key, owning_domain); + validator->ValidateInitialKey(owning_domain); } else { // Case #4 - verify new policy with existing key. We always allow key // rotation - the verification key will prevent invalid policy from being // injected. |persisted_policy_key_| is already known to be valid, so no // need to verify via ValidateCachedKey(). - validator->ValidateSignatureAllowingRotation( - persisted_policy_key_, verification_key, owning_domain); + validator->ValidateSignatureAllowingRotation(persisted_policy_key_, + owning_domain); } } @@ -443,10 +435,8 @@ // Persist the validated policy (just fire a task - don't bother getting a // reply because we can't do anything if it fails). background_task_runner()->PostTask( - FROM_HERE, - base::Bind(&StorePolicyToDiskOnBackgroundThread, - policy_path_, key_path_, verification_key_, - *validator->policy())); + FROM_HERE, base::Bind(&StorePolicyToDiskOnBackgroundThread, policy_path_, + key_path_, *validator->policy())); // If the key was rotated, update our local cache of the key. if (validator->policy()->has_new_public_key())
diff --git a/components/policy/core/common/cloud/user_cloud_policy_store.h b/components/policy/core/common/cloud/user_cloud_policy_store.h index 3dde9330..39f28bbf 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_store.h +++ b/components/policy/core/common/cloud/user_cloud_policy_store.h
@@ -37,7 +37,6 @@ UserCloudPolicyStore( const base::FilePath& policy_file, const base::FilePath& key_file, - const std::string& verification_key, scoped_refptr<base::SequencedTaskRunner> background_task_runner); ~UserCloudPolicyStore() override; @@ -45,7 +44,6 @@ // |profile_path|. static std::unique_ptr<UserCloudPolicyStore> Create( const base::FilePath& profile_path, - const std::string& verification_key, scoped_refptr<base::SequencedTaskRunner> background_task_runner); // The username from signin for validation of the policy. @@ -79,7 +77,6 @@ void Validate( std::unique_ptr<enterprise_management::PolicyFetchResponse> policy, std::unique_ptr<enterprise_management::PolicySigningKey> key, - const std::string& verification_key, bool validate_in_background, const UserCloudPolicyValidator::CompletionCallback& callback); @@ -104,9 +101,6 @@ // Path to file where we store the signing key for the policy blob. base::FilePath key_path_; - // The hard-coded key used to verify new signing keys. - const std::string verification_key_; - // The username from signin for validation of the policy. std::string signin_username_;
diff --git a/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc b/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc index 0382e3c..524f36f 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc +++ b/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc
@@ -57,7 +57,6 @@ void SetUp() override { ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); store_.reset(new UserCloudPolicyStore(policy_file(), key_file(), - GetPolicyVerificationKey(), loop_.task_runner())); external_data_manager_.reset(new MockCloudExternalDataManager); external_data_manager_->SetPolicyStore(store_.get()); @@ -354,9 +353,8 @@ EXPECT_FALSE(store_->policy_signature_public_key().empty()); // Now, make sure the policy can be read back in from a second store. - std::unique_ptr<UserCloudPolicyStore> store2(new UserCloudPolicyStore( - policy_file(), key_file(), GetPolicyVerificationKey(), - loop_.task_runner())); + std::unique_ptr<UserCloudPolicyStore> store2( + new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); store2->SetSigninUsername(PolicyBuilder::kFakeUsername); store2->AddObserver(&observer_); EXPECT_CALL(observer_, OnStoreLoaded(store2.get())); @@ -380,9 +378,8 @@ StorePolicyAndEnsureLoaded(policy_.policy()); // Now, make sure the policy can be read back in from a second store. - std::unique_ptr<UserCloudPolicyStore> store2(new UserCloudPolicyStore( - policy_file(), key_file(), GetPolicyVerificationKey(), - loop_.task_runner())); + std::unique_ptr<UserCloudPolicyStore> store2( + new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); store2->SetSigninUsername(PolicyBuilder::kFakeUsername); store2->AddObserver(&observer_); EXPECT_CALL(observer_, OnStoreLoaded(store2.get())); @@ -425,9 +422,8 @@ // Sign out, and sign back in as a different user, and try to load the profile // data (should fail due to mismatched username). - std::unique_ptr<UserCloudPolicyStore> store2(new UserCloudPolicyStore( - policy_file(), key_file(), GetPolicyVerificationKey(), - loop_.task_runner())); + std::unique_ptr<UserCloudPolicyStore> store2( + new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); store2->SetSigninUsername("foobar@foobar.com"); store2->AddObserver(&observer_); ExpectError(store2.get(), CloudPolicyStore::STATUS_VALIDATION_ERROR); @@ -439,9 +435,8 @@ // Sign out - we should be able to load the policy (don't check usernames // when signed out). - std::unique_ptr<UserCloudPolicyStore> store3(new UserCloudPolicyStore( - policy_file(), key_file(), GetPolicyVerificationKey(), - loop_.task_runner())); + std::unique_ptr<UserCloudPolicyStore> store3( + new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); store3->AddObserver(&observer_); EXPECT_CALL(observer_, OnStoreLoaded(store3.get())); store3->Load(); @@ -451,9 +446,8 @@ store3->RemoveObserver(&observer_); // Now start a signin as a different user - this should fail validation. - std::unique_ptr<UserCloudPolicyStore> store4(new UserCloudPolicyStore( - policy_file(), key_file(), GetPolicyVerificationKey(), - loop_.task_runner())); + std::unique_ptr<UserCloudPolicyStore> store4( + new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); store4->SetSigninUsername("foobar@foobar.com"); store4->AddObserver(&observer_); ExpectError(store4.get(), CloudPolicyStore::STATUS_VALIDATION_ERROR); @@ -480,9 +474,8 @@ // Now load this in a new store - this should trigger key rotation. The keys // will still verify using the existing verification key. - std::unique_ptr<UserCloudPolicyStore> store2(new UserCloudPolicyStore( - policy_file(), key_file(), GetPolicyVerificationKey(), - loop_.task_runner())); + std::unique_ptr<UserCloudPolicyStore> store2( + new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); store2->SetSigninUsername(PolicyBuilder::kFakeUsername); store2->AddObserver(&observer_); EXPECT_CALL(observer_, OnStoreLoaded(store2.get())); @@ -507,9 +500,8 @@ // Now load this in a new store - this should cause a validation error because // the key won't verify. - std::unique_ptr<UserCloudPolicyStore> store2(new UserCloudPolicyStore( - policy_file(), key_file(), GetPolicyVerificationKey(), - loop_.task_runner())); + std::unique_ptr<UserCloudPolicyStore> store2( + new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); store2->SetSigninUsername(PolicyBuilder::kFakeUsername); store2->AddObserver(&observer_); ExpectError(store2.get(), CloudPolicyStore::STATUS_VALIDATION_ERROR);
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 3ed6ea9..91e8e67 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -5814,11 +5814,11 @@ 'tags': [], 'supported_on': ['chrome_os:54-'], 'caption': '''Treat external storage devices as read-only.''', - 'desc': '''This policy is effective only when ExternalStorageDisabled is set to false or not configured. + 'desc': '''When this policy is set to true, users cannot write anything to external storage devices. - When this policy is set to true, users cannot write anything to external storage devices. + If this setting is set to false or not configured, then users can create and modify files of external storage devices which are physically writable. - If this setting is disabled or not configured then users can create and modify files of external storage devices which are physically writable. + The ExternalStorageDisabled policy takes precedence over this policy - if ExternalStorageDisabled is set to true, then all access to external storage is disabled and this policy is consequently ignored. Dynamic refresh of this policy is supported in M56 and later.''', 'features': { @@ -8074,7 +8074,7 @@ 'id': 346, 'caption': '''Enables force sign in for <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''', 'tags': [], - 'desc': '''If this policy is set to true, user has to sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> with his or her profile before using the browser. And the default value of BrowserGuestModeEnabled will be set to false. + 'desc': '''If this policy is set to true, user has to sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> with their profile before using the browser. And the default value of BrowserGuestModeEnabled will be set to false. If this policy is set to false or not configured, user can use the browser without sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''', },
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 824a9c3..02380e6 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -89,11 +89,11 @@ "//ipc:mojom", "//media", "//media/capture", + "//media/capture/mojo:image_capture", "//media/gpu/ipc/client", "//media/midi", "//media/midi:mojo_cpp_sources", "//media/mojo/interfaces", - "//media/mojo/interfaces:image_capture", "//mojo/common", "//mojo/edk/system", "//mojo/public/cpp/bindings",
diff --git a/content/browser/DEPS b/content/browser/DEPS index 0d798d5..27079e1 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS
@@ -75,7 +75,6 @@ "+third_party/WebKit/public/platform/mime_registry.mojom.h", "+third_party/WebKit/public/platform/modules/background_sync/background_sync.mojom.h", "+third_party/WebKit/public/platform/modules/broadcastchannel/broadcast_channel.mojom.h", - "+third_party/WebKit/public/platform/modules/imagecapture/image_capture.mojom.h", "+third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseException.h", "+third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h", "+third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h",
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc index 379727c1..96618fae 100644 --- a/content/browser/loader/async_resource_handler.cc +++ b/content/browser/loader/async_resource_handler.cc
@@ -72,14 +72,6 @@ GetNumericArg("resource-buffer-max-allocation-size", &kMaxAllocationSize); } -// Updates |*cached| to |updated| and returns the difference from the old -// value. -int TrackDifference(int64_t updated, int64_t* cached) { - int difference = updated - *cached; - *cached = updated; - return difference; -} - } // namespace // Used when kOptimizeLoadingIPCForSmallResources is enabled. @@ -125,7 +117,6 @@ // Returns true if the received data is sent to the consumer. bool SendInlinedDataIfApplicable(int bytes_read, int encoded_data_length, - int encoded_body_length, IPC::Sender* sender, int request_id) { DCHECK(sender); @@ -138,7 +129,7 @@ leading_chunk_buffer_ = nullptr; sender->Send(new ResourceMsg_InlinedDataChunkReceived( - request_id, data, encoded_data_length, encoded_body_length)); + request_id, data, encoded_data_length)); return true; } @@ -215,8 +206,7 @@ inlining_helper_(new InliningHelper), last_upload_position_(0), waiting_for_upload_progress_ack_(false), - reported_transfer_size_(0), - reported_encoded_body_length_(0) { + reported_transfer_size_(0) { InitializeResourceBufferConstants(); } @@ -430,12 +420,11 @@ if (!first_chunk_read_) encoded_data_length -= request()->raw_header_size(); - int encoded_body_length = CalculateEncodedBodyLengthToReport(); first_chunk_read_ = true; // Return early if InliningHelper handled the received data. if (inlining_helper_->SendInlinedDataIfApplicable( - bytes_read, encoded_data_length, encoded_body_length, filter, + bytes_read, encoded_data_length, filter, GetRequestID())) return true; @@ -455,8 +444,7 @@ int data_offset = buffer_->GetLastAllocationOffset(); filter->Send(new ResourceMsg_DataReceived(GetRequestID(), data_offset, - bytes_read, encoded_data_length, - encoded_body_length)); + bytes_read, encoded_data_length)); ++pending_data_count_; if (!buffer_->CanAllocate()) { @@ -559,13 +547,10 @@ } int AsyncResourceHandler::CalculateEncodedDataLengthToReport() { - return TrackDifference(request()->GetTotalReceivedBytes(), - &reported_transfer_size_); -} - -int AsyncResourceHandler::CalculateEncodedBodyLengthToReport() { - return TrackDifference(request()->GetRawBodyBytes(), - &reported_encoded_body_length_); + const auto transfer_size = request()->GetTotalReceivedBytes(); + const auto difference = transfer_size - reported_transfer_size_; + reported_transfer_size_ = transfer_size; + return difference; } void AsyncResourceHandler::RecordHistogram() {
diff --git a/content/browser/loader/async_resource_handler.h b/content/browser/loader/async_resource_handler.h index c02a38c..1279d50 100644 --- a/content/browser/loader/async_resource_handler.h +++ b/content/browser/loader/async_resource_handler.h
@@ -95,7 +95,6 @@ base::RepeatingTimer progress_timer_; int64_t reported_transfer_size_; - int64_t reported_encoded_body_length_; DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); };
diff --git a/content/browser/loader/async_resource_handler_unittest.cc b/content/browser/loader/async_resource_handler_unittest.cc index f069703..c4fe0d2e 100644 --- a/content/browser/loader/async_resource_handler_unittest.cc +++ b/content/browser/loader/async_resource_handler_unittest.cc
@@ -262,8 +262,6 @@ int encoded_data_length = std::get<3>(params); EXPECT_EQ(kDataSize, encoded_data_length); - int encoded_body_length = std::get<4>(params); - EXPECT_EQ(kDataSize, encoded_body_length); ASSERT_EQ(ResourceMsg_RequestComplete::ID, messages[3]->type()); ResourceMsg_RequestComplete::Param completion_params; @@ -294,8 +292,6 @@ int encoded_data_length = std::get<2>(params); EXPECT_EQ(kDataSize, encoded_data_length); - int encoded_body_length = std::get<3>(params); - EXPECT_EQ(kDataSize, encoded_body_length); ASSERT_EQ(ResourceMsg_RequestComplete::ID, messages[2]->type()); ResourceMsg_RequestComplete::Param completion_params; @@ -320,16 +316,12 @@ int encoded_data_length = std::get<3>(params); EXPECT_EQ(32768, encoded_data_length); - int encoded_body_length = std::get<4>(params); - EXPECT_EQ(32768, encoded_body_length); ASSERT_EQ(ResourceMsg_DataReceived::ID, messages[3]->type()); ResourceMsg_DataReceived::Read(messages[3].get(), ¶ms); encoded_data_length = std::get<3>(params); EXPECT_EQ(32768, encoded_data_length); - encoded_body_length = std::get<4>(params); - EXPECT_EQ(32768, encoded_body_length); ASSERT_EQ(ResourceMsg_RequestComplete::ID, messages[4]->type()); ResourceMsg_RequestComplete::Param completion_params;
diff --git a/content/browser/media/capture/image_capture_impl.h b/content/browser/media/capture/image_capture_impl.h index bb919cf3..a4b3cf4 100644 --- a/content/browser/media/capture/image_capture_impl.h +++ b/content/browser/media/capture/image_capture_impl.h
@@ -5,7 +5,7 @@ #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_IMAGE_CAPTURE_IMPL_H_ #define CONTENT_BROWSER_MEDIA_CAPTURE_IMAGE_CAPTURE_IMPL_H_ -#include "media/mojo/interfaces/image_capture.mojom.h" +#include "media/capture/mojo/image_capture.mojom.h" namespace content {
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc index a8d3ac2..0c116e9c 100644 --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
@@ -248,15 +248,18 @@ return; LatencyInfo::LatencyComponent original_component; + std::string scroll_name = "ScrollUpdate"; if (latency.FindLatency( ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, latency_component_id, &original_component)) { + scroll_name = "ScrollBegin"; // This UMA metric tracks the time between the final frame swap for the // first scroll event in a sequence and the original timestamp of that // scroll event's underlying touch/wheel event. + UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY( - "Event.Latency.ScrollUpdate." + event_type_name + - ".TimeToFirstScrollUpdateSwapBegin2", + "Event.Latency.ScrollBegin." + event_type_name + + ".TimeToScrollUpdateSwapBegin2", original_component, gpu_swap_begin_component); } else if (latency.FindLatency( ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, @@ -289,7 +292,7 @@ const std::string thread_name = rendering_scheduled_on_main ? "Main" : "Impl"; UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2( - "Event.Latency.ScrollUpdate." + event_type_name + + "Event.Latency." + scroll_name + "." + event_type_name + ".TimeToHandled2_" + thread_name, original_component, rendering_scheduled_component); @@ -299,7 +302,7 @@ return; UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2( - "Event.Latency.ScrollUpdate." + event_type_name + + "Event.Latency." + scroll_name + "." + event_type_name + ".HandledToRendererSwap2_" + thread_name, rendering_scheduled_component, renderer_swap_component); @@ -310,17 +313,17 @@ return; UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2( - "Event.Latency.ScrollUpdate." + event_type_name + + "Event.Latency." + scroll_name + "." + event_type_name + ".RendererSwapToBrowserNotified2", renderer_swap_component, browser_received_swap_component); UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2( - "Event.Latency.ScrollUpdate." + event_type_name + + "Event.Latency." + scroll_name + "." + event_type_name + ".BrowserNotifiedToBeforeGpuSwap2", browser_received_swap_component, gpu_swap_begin_component); UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2( - "Event.Latency.ScrollUpdate." + event_type_name + ".GpuSwap2", + "Event.Latency." + scroll_name + "." + event_type_name + ".GpuSwap2", gpu_swap_begin_component, gpu_swap_end_component); } // LatencyComponents generated in the renderer must have component IDs
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc index 549945ec..813735f 100644 --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
@@ -28,9 +28,6 @@ latency->AddLatencyNumberWithTimestamp( ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, time_stamp, 1); latency->AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, - tracker.latency_component_id(), 0, time_stamp, 1); - latency->AddLatencyNumberWithTimestamp( ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, 0, time_stamp, 1); latency->AddLatencyNumberWithTimestamp( ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, 0, 0, @@ -39,6 +36,9 @@ void AddFakeComponents(const RenderWidgetHostLatencyTracker& tracker, ui::LatencyInfo* latency) { + latency->AddLatencyNumberWithTimestamp( + ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, + tracker.latency_component_id(), 0, base::TimeTicks::Now(), 1); AddFakeComponentsWithTimeStamp(tracker, latency, base::TimeTicks::Now()); } @@ -95,7 +95,8 @@ std::unique_ptr<base::HistogramTester> histogram_tester_; RenderWidgetHostLatencyTracker tracker_; }; -TEST_F(RenderWidgetHostLatencyTrackerTest, TestWheelHistograms) { + +TEST_F(RenderWidgetHostLatencyTrackerTest, TestWheelToFirstScrollHistograms) { for (bool rendering_on_main : {false, true}) { for (bool is_running_navigation_hint_task : {false, true}) { ResetHistograms(); @@ -105,6 +106,9 @@ base::TimeTicks now = base::TimeTicks::Now(); wheel.timeStampSeconds = (now - base::TimeTicks()).InSecondsF(); ui::LatencyInfo wheel_latency(ui::SourceEventType::WHEEL); + wheel_latency.AddLatencyNumberWithTimestamp( + ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, + tracker()->latency_component_id(), 0, now, 1); AddFakeComponentsWithTimeStamp(*tracker(), &wheel_latency, now); AddRenderingScheduledComponent(&wheel_latency, rendering_on_main, now); tracker()->OnInputEvent(wheel, &wheel_latency); @@ -122,9 +126,104 @@ EXPECT_TRUE(HistogramSizeEq("Event.Latency.Browser.WheelAcked", 1)); EXPECT_TRUE( - HistogramSizeEq("Event.Latency.ScrollUpdate.Wheel." - "TimeToFirstScrollUpdateSwapBegin2", + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." + "TimeToScrollUpdateSwapBegin2", 1)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.TimeToHandled2_Main", + rendering_on_main ? 1 : 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.TimeToHandled2_Impl", + rendering_on_main ? 0 : 1)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.HandledToRendererSwap2_Main", + rendering_on_main ? 1 : 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.HandledToRendererSwap2_Impl", + rendering_on_main ? 0 : 1)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." + "RendererSwapToBrowserNotified2", + 1)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." + "BrowserNotifiedToBeforeGpuSwap2", + 1)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel.GpuSwap2", 1)); + + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Wheel.TimeToHandled2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Wheel.TimeToHandled2_Impl", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Wheel.HandledToRendererSwap2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Wheel.HandledToRendererSwap2_Impl", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Wheel.RendererSwapToBrowserNotified2", + 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Wheel.BrowserNotifiedToBeforeGpuSwap2", + 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollUpdate.Wheel.GpuSwap2", 0)); + } + } + } +} + +TEST_F(RenderWidgetHostLatencyTrackerTest, TestWheelToScrollHistograms) { + for (bool rendering_on_main : {false, true}) { + for (bool is_running_navigation_hint_task : {false, true}) { + ResetHistograms(); + { + auto wheel = SyntheticWebMouseWheelEventBuilder::Build( + blink::WebMouseWheelEvent::PhaseChanged); + base::TimeTicks now = base::TimeTicks::Now(); + wheel.timeStampSeconds = (now - base::TimeTicks()).InSecondsF(); + ui::LatencyInfo wheel_latency(ui::SourceEventType::WHEEL); + wheel_latency.AddLatencyNumberWithTimestamp( + ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, + tracker()->latency_component_id(), 0, now, 1); + AddFakeComponentsWithTimeStamp(*tracker(), &wheel_latency, now); + AddRenderingScheduledComponent(&wheel_latency, rendering_on_main, now); + tracker()->OnInputEvent(wheel, &wheel_latency); + EXPECT_TRUE(wheel_latency.FindLatency( + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, + tracker()->latency_component_id(), nullptr)); + EXPECT_TRUE(wheel_latency.FindLatency( + ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr)); + EXPECT_EQ(1U, wheel_latency.input_coordinates_size()); + tracker()->OnInputEventAck(wheel, &wheel_latency, + INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + tracker()->OnFrameSwapped(wheel_latency, + is_running_navigation_hint_task); + EXPECT_TRUE(HistogramSizeEq("Event.Latency.Browser.WheelUI", 1)); + EXPECT_TRUE(HistogramSizeEq("Event.Latency.Browser.WheelAcked", 1)); + + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." + "TimeToScrollUpdateSwapBegin2", + 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.TimeToHandled2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.TimeToHandled2_Impl", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.HandledToRendererSwap2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Wheel.HandledToRendererSwap2_Impl", 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." + "RendererSwapToBrowserNotified2", + 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." + "BrowserNotifiedToBeforeGpuSwap2", + 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Wheel.GpuSwap2", 0)); EXPECT_TRUE(HistogramSizeEq( "Event.Latency.ScrollUpdate.Wheel.TimeToHandled2_Main", @@ -151,7 +250,7 @@ } } -TEST_F(RenderWidgetHostLatencyTrackerTest, TestTouchHistograms) { +TEST_F(RenderWidgetHostLatencyTrackerTest, TestTouchToFirstScrollHistograms) { for (bool rendering_on_main : {false, true}) { for (bool is_running_navigation_hint_task : {false, true}) { ResetHistograms(); @@ -161,6 +260,9 @@ base::TimeTicks now = base::TimeTicks::Now(); scroll.timeStampSeconds = (now - base::TimeTicks()).InSecondsF(); ui::LatencyInfo scroll_latency; + scroll_latency.AddLatencyNumberWithTimestamp( + ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, + tracker()->latency_component_id(), 0, now, 1); AddFakeComponentsWithTimeStamp(*tracker(), &scroll_latency, now); AddRenderingScheduledComponent(&scroll_latency, rendering_on_main, now); tracker()->OnInputEvent(scroll, &scroll_latency); @@ -180,6 +282,9 @@ touch.PressPoint(1, 1); ui::LatencyInfo touch_latency(ui::SourceEventType::TOUCH); base::TimeTicks now = base::TimeTicks::Now(); + touch_latency.AddLatencyNumberWithTimestamp( + ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, + tracker()->latency_component_id(), 0, now, 1); AddFakeComponentsWithTimeStamp(*tracker(), &touch_latency, now); AddRenderingScheduledComponent(&touch_latency, rendering_on_main, now); tracker()->OnInputEvent(touch, &touch_latency); @@ -227,12 +332,127 @@ "Event.Latency.ScrollUpdate.BrowserNotifiedToBeforeGpuSwap", 1)); EXPECT_TRUE(HistogramSizeEq("Event.Latency.ScrollUpdate.GpuSwap", 1)); EXPECT_TRUE(HistogramSizeEq( - "Event.Latency.ScrollUpdate.Touch.TimeToFirstScrollUpdateSwapBegin2", - 1)); + "Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin2", 1)); EXPECT_TRUE(HistogramSizeEq( "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2", 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch.TimeToHandled2_Main", + rendering_on_main ? 1 : 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch.TimeToHandled2_Impl", + rendering_on_main ? 0 : 1)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Touch.HandledToRendererSwap2_Main", + rendering_on_main ? 1 : 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Touch.HandledToRendererSwap2_Impl", + rendering_on_main ? 0 : 1)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch." + "RendererSwapToBrowserNotified2", + 1)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch." + "BrowserNotifiedToBeforeGpuSwap2", + 1)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch.GpuSwap2", 1)); + + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Touch.TimeToHandled2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Touch.TimeToHandled2_Impl", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Touch.HandledToRendererSwap2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Touch.HandledToRendererSwap2_Impl", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Touch.RendererSwapToBrowserNotified2", + 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Touch.BrowserNotifiedToBeforeGpuSwap2", + 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollUpdate.Touch.GpuSwap2", 0)); + } + } +} + +TEST_F(RenderWidgetHostLatencyTrackerTest, TestTouchToScrollHistograms) { + for (bool rendering_on_main : {false, true}) { + for (bool is_running_navigation_hint_task : {false, true}) { + ResetHistograms(); + { + auto scroll = SyntheticWebGestureEventBuilder::BuildScrollUpdate( + 5.f, -5.f, 0, blink::WebGestureDeviceTouchscreen); + base::TimeTicks now = base::TimeTicks::Now(); + scroll.timeStampSeconds = (now - base::TimeTicks()).InSecondsF(); + ui::LatencyInfo scroll_latency; + scroll_latency.AddLatencyNumberWithTimestamp( + ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, + tracker()->latency_component_id(), 0, now, 1); + AddFakeComponentsWithTimeStamp(*tracker(), &scroll_latency, now); + AddRenderingScheduledComponent(&scroll_latency, rendering_on_main, now); + tracker()->OnInputEvent(scroll, &scroll_latency); + EXPECT_TRUE(scroll_latency.FindLatency( + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, + tracker()->latency_component_id(), nullptr)); + EXPECT_TRUE(scroll_latency.FindLatency( + ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr)); + EXPECT_EQ(1U, scroll_latency.input_coordinates_size()); + tracker()->OnInputEventAck(scroll, &scroll_latency, + INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + } + + { + SyntheticWebTouchEvent touch; + touch.PressPoint(0, 0); + touch.PressPoint(1, 1); + ui::LatencyInfo touch_latency(ui::SourceEventType::TOUCH); + base::TimeTicks now = base::TimeTicks::Now(); + touch_latency.AddLatencyNumberWithTimestamp( + ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, + tracker()->latency_component_id(), 0, now, 1); + AddFakeComponentsWithTimeStamp(*tracker(), &touch_latency, now); + AddRenderingScheduledComponent(&touch_latency, rendering_on_main, now); + tracker()->OnInputEvent(touch, &touch_latency); + EXPECT_TRUE(touch_latency.FindLatency( + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, + tracker()->latency_component_id(), nullptr)); + EXPECT_TRUE(touch_latency.FindLatency( + ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr)); + EXPECT_EQ(2U, touch_latency.input_coordinates_size()); + tracker()->OnInputEventAck(touch, &touch_latency, + INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + tracker()->OnFrameSwapped(touch_latency, + is_running_navigation_hint_task); + } + + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin2", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2", 1)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Touch.TimeToHandled2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Touch.TimeToHandled2_Impl", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Touch.HandledToRendererSwap2_Main", 0)); + EXPECT_TRUE(HistogramSizeEq( + "Event.Latency.ScrollBegin.Touch.HandledToRendererSwap2_Impl", 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch." + "RendererSwapToBrowserNotified2", + 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch." + "BrowserNotifiedToBeforeGpuSwap2", + 0)); + EXPECT_TRUE( + HistogramSizeEq("Event.Latency.ScrollBegin.Touch.GpuSwap2", 0)); + EXPECT_TRUE(HistogramSizeEq( "Event.Latency.ScrollUpdate.Touch.TimeToHandled2_Main", rendering_on_main ? 1 : 0));
diff --git a/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc b/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc index 1ac1f9d7..6627511 100644 --- a/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc
@@ -39,7 +39,7 @@ ScopedFakeClock() { prev_clock_ = rtc::SetClockForTesting(this); } ~ScopedFakeClock() override { rtc::SetClockForTesting(prev_clock_); } // ClockInterface implementation. - uint64_t TimeNanos() const override { return time_nanos_; } + int64_t TimeNanos() const override { return time_nanos_; } void SetTimeNanos(uint64_t time_nanos) { time_nanos_ = time_nanos; } private:
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index 08ef4ae..d4cb855 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -468,6 +468,9 @@ host_->SetView(this); SetContentViewCore(content_view_core); + + if (GetTextInputManager()) + GetTextInputManager()->AddObserver(this); } RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() { @@ -757,22 +760,29 @@ return reinterpret_cast<intptr_t>(&ime_adapter_android_); } -void RenderWidgetHostViewAndroid::TextInputStateChanged( - const TextInputState& params) { - if (params.is_non_ime_change) { +// ----------------------------------------------------------------------------- +// TextInputManager::Observer implementations. +void RenderWidgetHostViewAndroid::OnUpdateTextInputStateCalled( + TextInputManager* text_input_manager, + RenderWidgetHostViewBase* updated_view, + bool did_change_state) { + DCHECK_EQ(text_input_manager_, text_input_manager); + const TextInputState& state = + *GetTextInputManager()->GetTextInputState(updated_view); + if (state.is_non_ime_change && updated_view->GetRenderWidgetHost()) { // Sends an acknowledgement to the renderer of a processed IME event. - host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); + updated_view->GetRenderWidgetHost()->Send( + new InputMsg_ImeEventAck(host_->GetRoutingID())); } if (!content_view_core_) return; content_view_core_->UpdateImeAdapter( - GetNativeImeAdapter(), - static_cast<int>(params.type), params.flags, - params.value, params.selection_start, params.selection_end, - params.composition_start, params.composition_end, - params.show_ime_if_needed, params.is_non_ime_change); + GetNativeImeAdapter(), static_cast<int>(state.type), state.flags, + state.value, state.selection_start, state.selection_end, + state.composition_start, state.composition_end, state.show_ime_if_needed, + state.is_non_ime_change); } void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { @@ -926,6 +936,9 @@ // The RenderWidgetHost's destruction led here, so don't call it. host_ = NULL; + if (GetTextInputManager() && GetTextInputManager()->HasObserver(this)) + GetTextInputManager()->RemoveObserver(this); + delete this; }
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index 0ac77152..43688e9 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -26,6 +26,7 @@ #include "content/browser/renderer_host/ime_adapter_android.h" #include "content/browser/renderer_host/input/stylus_text_selector.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" +#include "content/browser/renderer_host/text_input_manager.h" #include "content/common/content_export.h" #include "content/public/browser/readback_types.h" #include "gpu/command_buffer/common/mailbox.h" @@ -65,7 +66,6 @@ class SynchronousCompositorHost; class SynchronousCompositorClient; struct NativeWebKeyboardEvent; -struct TextInputState; // ----------------------------------------------------------------------------- // See comments in render_widget_host_view.h about this class and its members. @@ -77,7 +77,8 @@ public DelegatedFrameEvictorClient, public StylusTextSelectorClient, public ui::TouchSelectionControllerClient, - public content::ContentViewCoreImplObserver { + public content::ContentViewCoreImplObserver, + public content::TextInputManager::Observer { public: RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, ContentViewCoreImpl* content_view_core); @@ -111,7 +112,6 @@ float GetBottomControlsHeight() const override; void UpdateCursor(const WebCursor& cursor) override; void SetIsLoading(bool is_loading) override; - void TextInputStateChanged(const TextInputState& params) override; void ImeCancelComposition() override; void ImeCompositionRangeChanged( const gfx::Range& range, @@ -247,6 +247,11 @@ static void OnContextLost(); + // TextInputManager::Observer overrides. + void OnUpdateTextInputStateCalled(TextInputManager* text_input_manager, + RenderWidgetHostViewBase* updated_view, + bool did_change_state) override; + private: void RunAckCallbacks();
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index 6408c68..561cff21 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -469,11 +469,8 @@ void RenderWidgetHostViewBase::TextInputStateChanged( const TextInputState& text_input_state) { -// TODO(ekaramad): Use TextInputManager code paths for IME on other platforms. -#if !defined(OS_ANDROID) if (GetTextInputManager()) GetTextInputManager()->UpdateTextInputState(this, text_input_state); -#endif } void RenderWidgetHostViewBase::ImeCancelComposition() {
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc index 3b75d36a..746e910 100644 --- a/content/browser/renderer_host/text_input_manager.cc +++ b/content/browser/renderer_host/text_input_manager.cc
@@ -15,7 +15,7 @@ namespace { -bool AreDifferentTextInputStates(const content::TextInputState& old_state, +bool ShouldUpdateTextInputState(const content::TextInputState& old_state, const content::TextInputState& new_state) { #if defined(USE_AURA) return old_state.type != new_state.type || old_state.mode != new_state.mode || @@ -24,8 +24,11 @@ #elif defined(OS_MACOSX) return old_state.type != new_state.type || old_state.can_compose_inline != new_state.can_compose_inline; +#elif defined(OS_ANDROID) + // On Android, TextInputState update is sent only if there is some change in + // the state. So the new state is always different. + return true; #else - // TODO(ekaramad): Implement the logic for other platforms (crbug.com/578168). NOTREACHED(); return true; #endif @@ -57,8 +60,12 @@ : nullptr; } -const TextInputState* TextInputManager::GetTextInputState() const { - return !!active_view_ ? &text_input_state_map_.at(active_view_) : nullptr; +const TextInputState* TextInputManager::GetTextInputState( + RenderWidgetHostViewBase* view) const { + DCHECK(!view || IsRegistered(view)); + if (!view) + view = active_view_; + return !!view ? &text_input_state_map_.at(view) : nullptr; } const TextInputManager::SelectionRegion* TextInputManager::GetSelectionRegion( @@ -105,8 +112,8 @@ // Since |view| is registered, we already have a previous value for its // TextInputState. - bool changed = AreDifferentTextInputStates(text_input_state_map_[view], - text_input_state); + bool changed = ShouldUpdateTextInputState(text_input_state_map_[view], + text_input_state); text_input_state_map_[view] = text_input_state;
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h index db2383bd..0700d32 100644 --- a/content/browser/renderer_host/text_input_manager.h +++ b/content/browser/renderer_host/text_input_manager.h
@@ -123,9 +123,12 @@ // Users of these methods should not hold on to the pointers as they become // dangling if the TextInputManager or |active_view_| are destroyed. - // Returns the currently stored TextInputState. An state of nullptr can be - // interpreted as a ui::TextInputType of ui::TEXT_INPUT_TYPE_NONE. - const TextInputState* GetTextInputState() const; + // Returns the currently stored TextInputState for |view|. A state of nullptr + // can be interpreted as a ui::TextInputType of ui::TEXT_INPUT_TYPE_NONE for + // the view. If |view| is null and there is an |active_view_|, the state for + // |active_view_| is returned. + const TextInputState* GetTextInputState( + RenderWidgetHostViewBase* view = nullptr) const; // Returns the selection bounds information for |view|. If |view| == nullptr, // it will return the corresponding information for |active_view_| or nullptr
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 494b5c504..5e0a3e2 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -8374,6 +8374,8 @@ "};\n")); // Navigate B's subframe to a cross-site C. + RenderFrameDeletedObserver deleted_observer( + root->child_at(0)->child_at(0)->current_frame_host()); std::string script = std::string("window.document.getElementById('child-0').src = \"") + embedded_test_server() @@ -8384,8 +8386,6 @@ ExecuteScript(root->child_at(0)->current_frame_host(), script.c_str())); // Wait until B's subframe RenderFrameHost is destroyed. - RenderFrameDeletedObserver deleted_observer( - root->child_at(0)->child_at(0)->current_frame_host()); deleted_observer.WaitUntilDeleted(); // Check that C's subframe is alive and the navigation in the unload handler
diff --git a/content/child/ftp_directory_listing_response_delegate.cc b/content/child/ftp_directory_listing_response_delegate.cc index ba0f074..faf2123 100644 --- a/content/child/ftp_directory_listing_response_delegate.cc +++ b/content/child/ftp_directory_listing_response_delegate.cc
@@ -131,8 +131,7 @@ void FtpDirectoryListingResponseDelegate::SendDataToClient( const std::string& data) { if (client_) { - client_->didReceiveData(loader_, data.data(), data.length(), -1, - data.length()); + client_->didReceiveData(loader_, data.data(), data.length(), -1); } }
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index e242b5e..e43f1b1 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc
@@ -306,8 +306,7 @@ void ResourceDispatcher::OnReceivedInlinedDataChunk( int request_id, const std::vector<char>& data, - int encoded_data_length, - int encoded_body_length) { + int encoded_data_length) { TRACE_EVENT0("loader", "ResourceDispatcher::OnReceivedInlinedDataChunk"); DCHECK(!data.empty()); DCHECK(base::FeatureList::IsEnabled( @@ -327,17 +326,14 @@ DCHECK(!request_info->buffer.get()); - std::unique_ptr<RequestPeer::ReceivedData> received_data( - new content::FixedReceivedData(data, encoded_data_length, - encoded_body_length)); - request_info->peer->OnReceivedData(std::move(received_data)); + request_info->peer->OnReceivedData( + base::MakeUnique<content::FixedReceivedData>(data, encoded_data_length)); } void ResourceDispatcher::OnReceivedData(int request_id, int data_offset, int data_length, - int encoded_data_length, - int encoded_body_length) { + int encoded_data_length) { TRACE_EVENT0("loader", "ResourceDispatcher::OnReceivedData"); DCHECK_GT(data_length, 0); PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); @@ -360,8 +356,8 @@ } std::unique_ptr<RequestPeer::ReceivedData> data = - request_info->received_data_factory->Create( - data_offset, data_length, encoded_data_length, encoded_body_length); + request_info->received_data_factory->Create(data_offset, data_length, + encoded_data_length); // |data| takes care of ACKing. send_ack = false; request_info->peer->OnReceivedData(std::move(data)); @@ -466,7 +462,8 @@ request_complete_data.was_ignored_by_handler, request_complete_data.exists_in_cache, renderer_completion_time, - request_complete_data.encoded_data_length); + request_complete_data.encoded_data_length, + request_complete_data.encoded_body_length); } bool ResourceDispatcher::RemovePendingRequest(int request_id) {
diff --git a/content/child/resource_dispatcher.h b/content/child/resource_dispatcher.h index 7c84755..42063805 100644 --- a/content/child/resource_dispatcher.h +++ b/content/child/resource_dispatcher.h
@@ -215,13 +215,11 @@ base::ProcessId renderer_pid); void OnReceivedInlinedDataChunk(int request_id, const std::vector<char>& data, - int encoded_data_length, - int encoded_body_length); + int encoded_data_length); void OnReceivedData(int request_id, int data_offset, int data_length, - int encoded_data_length, - int encoded_body_length); + int encoded_data_length); void OnDownloadedData(int request_id, int data_len, int encoded_data_length); void OnRequestComplete( int request_id,
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc index 02ae8fd..0b4dc7e2 100644 --- a/content/child/resource_dispatcher_unittest.cc +++ b/content/child/resource_dispatcher_unittest.cc
@@ -104,7 +104,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) override { + int64_t total_transfer_size, + int64_t encoded_body_size) override { if (context_->cancelled) return; EXPECT_TRUE(context_->received_response); @@ -274,14 +275,14 @@ data.length()); EXPECT_TRUE(dispatcher_->OnMessageReceived(ResourceMsg_DataReceived( - request_id, 0, data.length(), data.length(), data.length()))); + request_id, 0, data.length(), data.length()))); } void NotifyInlinedDataChunkReceived(int request_id, const std::vector<char>& data) { auto size = data.size(); EXPECT_TRUE(dispatcher_->OnMessageReceived( - ResourceMsg_InlinedDataChunkReceived(request_id, data, size, size))); + ResourceMsg_InlinedDataChunkReceived(request_id, data, size))); } void NotifyDataDownloaded(int request_id, @@ -544,15 +545,16 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) override { + int64_t total_transfer_size, + int64_t encoded_body_size) override { original_peer_->OnReceivedResponse(response_info_); if (!data_.empty()) { original_peer_->OnReceivedData(base::MakeUnique<FixedReceivedData>( - data_.data(), data_.size(), -1, data_.size())); + data_.data(), data_.size(), -1)); } - original_peer_->OnCompletedRequest(error_code, was_ignored_by_handler, - stale_copy_in_cache, completion_time, - total_transfer_size); + original_peer_->OnCompletedRequest( + error_code, was_ignored_by_handler, stale_copy_in_cache, + completion_time, total_transfer_size, encoded_body_size); } private:
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 34ce801..956aaca 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -261,9 +261,6 @@ WebRuntimeFeatures::enablePointerEvent( base::FeatureList::IsEnabled(features::kPointerEvents)); - if (base::FeatureList::IsEnabled(features::kPointerEventV1SpecCapturing)) - WebRuntimeFeatures::enablePointerEventV1SpecCapturing(true); - WebRuntimeFeatures::enablePassiveDocumentEventListeners( base::FeatureList::IsEnabled(features::kPassiveDocumentEventListeners));
diff --git a/content/child/shared_memory_data_consumer_handle.cc b/content/child/shared_memory_data_consumer_handle.cc index 69a369d..091eb50 100644 --- a/content/child/shared_memory_data_consumer_handle.cc +++ b/content/child/shared_memory_data_consumer_handle.cc
@@ -40,9 +40,6 @@ int encoded_data_length() const override { return data_->encoded_data_length(); } - int encoded_body_length() const override { - return data_->encoded_body_length(); - } private: std::unique_ptr<RequestPeer::ReceivedData> data_;
diff --git a/content/child/shared_memory_data_consumer_handle_unittest.cc b/content/child/shared_memory_data_consumer_handle_unittest.cc index e9ebe02..7c976fd5 100644 --- a/content/child/shared_memory_data_consumer_handle_unittest.cc +++ b/content/child/shared_memory_data_consumer_handle_unittest.cc
@@ -86,9 +86,6 @@ int encoded_data_length() const override { return static_cast<int>(data_.size()); } - int encoded_body_length() const override { - return static_cast<int>(data_.size()); - } private: const std::string name_; @@ -204,7 +201,7 @@ } std::unique_ptr<FixedReceivedData> NewFixedData(const char* s) { auto size = strlen(s); - return base::MakeUnique<FixedReceivedData>(s, size, size, size); + return base::MakeUnique<FixedReceivedData>(s, size, size); } StrictMock<MockClient> client_;
diff --git a/content/child/shared_memory_received_data_factory.cc b/content/child/shared_memory_received_data_factory.cc index 5b62db8..0fb59ea 100644 --- a/content/child/shared_memory_received_data_factory.cc +++ b/content/child/shared_memory_received_data_factory.cc
@@ -20,13 +20,11 @@ const char* payload, int length, int encoded_data_length, - int encoded_body_length, scoped_refptr<SharedMemoryReceivedDataFactory> factory, SharedMemoryReceivedDataFactory::TicketId id) : payload_(payload), length_(length), encoded_data_length_(encoded_data_length), - encoded_body_length_(encoded_body_length), factory_(factory), id_(id) {} @@ -35,13 +33,11 @@ const char* payload() const override { return payload_; } int length() const override { return length_; } int encoded_data_length() const override { return encoded_data_length_; } - int encoded_body_length() const override { return encoded_body_length_; } private: const char* const payload_; const int length_; const int encoded_data_length_; - const int encoded_body_length_; scoped_refptr<SharedMemoryReceivedDataFactory> factory_; SharedMemoryReceivedDataFactory::TicketId id_; @@ -69,14 +65,13 @@ std::unique_ptr<RequestPeer::ReceivedData> SharedMemoryReceivedDataFactory::Create(int offset, int length, - int encoded_data_length, - int encoded_body_length) { + int encoded_data_length) { const char* start = static_cast<char*>(memory_->memory()); const char* payload = start + offset; TicketId id = id_++; return base::MakeUnique<SharedMemoryReceivedData>( - payload, length, encoded_data_length, encoded_body_length, this, id); + payload, length, encoded_data_length, this, id); } void SharedMemoryReceivedDataFactory::Stop() {
diff --git a/content/child/shared_memory_received_data_factory.h b/content/child/shared_memory_received_data_factory.h index 77c7954..060a0d2 100644 --- a/content/child/shared_memory_received_data_factory.h +++ b/content/child/shared_memory_received_data_factory.h
@@ -33,8 +33,7 @@ std::unique_ptr<RequestPeer::ReceivedData> Create(int offset, int length, - int encoded_data_length, - int encoded_body_length); + int encoded_data_length); // Stops this factory. After calling this function, releasing issued data // won't send ack signal to the browser process.
diff --git a/content/child/shared_memory_received_data_factory_unittest.cc b/content/child/shared_memory_received_data_factory_unittest.cc index 8a2411b..65bad7c 100644 --- a/content/child/shared_memory_received_data_factory_unittest.cc +++ b/content/child/shared_memory_received_data_factory_unittest.cc
@@ -72,14 +72,13 @@ EXPECT_CALL(*sender_, SendAck(request_id_)); EXPECT_CALL(checkpoint, Call(1)); - std::unique_ptr<ReceivedData> data = factory_->Create(12, 34, 56, 30); + std::unique_ptr<ReceivedData> data = factory_->Create(12, 34, 56); const char* memory_start = static_cast<const char*>(memory_->memory()); ASSERT_TRUE(data); EXPECT_EQ(memory_start + 12, data->payload()); EXPECT_EQ(34, data->length()); EXPECT_EQ(56, data->encoded_data_length()); - EXPECT_EQ(30, data->encoded_body_length()); checkpoint.Call(0); data.reset(); @@ -97,9 +96,9 @@ EXPECT_CALL(*sender_, SendAck(request_id_)); EXPECT_CALL(checkpoint, Call(3)); - std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1, 1); - std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1, 1); - std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1, 1); + std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1); + std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1); + std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1); EXPECT_TRUE(data1); EXPECT_TRUE(data2); @@ -125,9 +124,9 @@ EXPECT_CALL(*sender_, SendAck(request_id_)); EXPECT_CALL(checkpoint, Call(3)); - std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1, 1); - std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1, 1); - std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1, 1); + std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1); + std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1); + std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1); EXPECT_TRUE(data1); EXPECT_TRUE(data2); @@ -157,12 +156,12 @@ EXPECT_CALL(*sender_, SendAck(request_id_)); EXPECT_CALL(checkpoint, Call(4)); - std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1, 1); - std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1, 1); - std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1, 1); - std::unique_ptr<ReceivedData> data4 = factory_->Create(3, 1, 1, 1); - std::unique_ptr<ReceivedData> data5 = factory_->Create(4, 1, 1, 1); - std::unique_ptr<ReceivedData> data6 = factory_->Create(5, 1, 1, 1); + std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1); + std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1); + std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1); + std::unique_ptr<ReceivedData> data4 = factory_->Create(3, 1, 1); + std::unique_ptr<ReceivedData> data5 = factory_->Create(4, 1, 1); + std::unique_ptr<ReceivedData> data6 = factory_->Create(5, 1, 1); EXPECT_TRUE(data1); EXPECT_TRUE(data2); @@ -195,12 +194,12 @@ EXPECT_CALL(checkpoint, Call(2)); EXPECT_CALL(checkpoint, Call(3)); - std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1, 1); - std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1, 1); - std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1, 1); - std::unique_ptr<ReceivedData> data4 = factory_->Create(3, 1, 1, 1); - std::unique_ptr<ReceivedData> data5 = factory_->Create(4, 1, 1, 1); - std::unique_ptr<ReceivedData> data6 = factory_->Create(5, 1, 1, 1); + std::unique_ptr<ReceivedData> data1 = factory_->Create(0, 1, 1); + std::unique_ptr<ReceivedData> data2 = factory_->Create(1, 1, 1); + std::unique_ptr<ReceivedData> data3 = factory_->Create(2, 1, 1); + std::unique_ptr<ReceivedData> data4 = factory_->Create(3, 1, 1); + std::unique_ptr<ReceivedData> data5 = factory_->Create(4, 1, 1); + std::unique_ptr<ReceivedData> data6 = factory_->Create(5, 1, 1); EXPECT_TRUE(data1); EXPECT_TRUE(data2);
diff --git a/content/child/url_response_body_consumer.cc b/content/child/url_response_body_consumer.cc index 0bbb44d..a231d9a 100644 --- a/content/child/url_response_body_consumer.cc +++ b/content/child/url_response_body_consumer.cc
@@ -26,10 +26,9 @@ const char* payload() const override { return payload_; } int length() const override { return length_; } - // TODO(yhirano): These return incorrect values. Remove these from + // TODO(yhirano): This returns an incorrect value. Remove it from // ReceivedData before enabling Mojo-Loading. int encoded_data_length() const override { return length_; } - int encoded_body_length() const override { return length_; } private: const char* const payload_;
diff --git a/content/child/url_response_body_consumer_unittest.cc b/content/child/url_response_body_consumer_unittest.cc index 5feacc6..ebd44c49 100644 --- a/content/child/url_response_body_consumer_unittest.cc +++ b/content/child/url_response_body_consumer_unittest.cc
@@ -58,7 +58,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) override { + int64_t total_transfer_size, + int64_t encoded_body_size) override { EXPECT_FALSE(context_->complete); context_->complete = true; context_->error_code = error_code;
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc index 669f6901..441b6f8d 100644 --- a/content/child/web_url_loader_impl.cc +++ b/content/child/web_url_loader_impl.cc
@@ -390,7 +390,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size); + int64_t total_transfer_size, + int64_t encoded_body_size); private: friend class base::RefCounted<Context>; @@ -438,7 +439,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) override; + int64_t total_transfer_size, + int64_t encoded_body_size) override; private: scoped_refptr<Context> context_; @@ -813,8 +815,7 @@ } else { // We dispatch the data even when |useStreamOnResponse()| is set, in order // to make Devtools work. - client_->didReceiveData(loader_, payload, data_length, encoded_data_length, - data->encoded_body_length()); + client_->didReceiveData(loader_, payload, data_length, encoded_data_length); if (request_.useStreamOnResponse()) { // We don't support ftp_listening_delegate_ for now. @@ -839,7 +840,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) { + int64_t total_transfer_size, + int64_t encoded_body_size) { if (ftp_listing_delegate_) { ftp_listing_delegate_->OnCompletedRequest(); ftp_listing_delegate_.reset(NULL); @@ -858,11 +860,11 @@ client_->didFail(loader_, CreateWebURLError(request_.url(), stale_copy_in_cache, error_code, was_ignored_by_handler), - total_transfer_size); + total_transfer_size, encoded_body_size); } else { client_->didFinishLoading(loader_, (completion_time - TimeTicks()).InSecondsF(), - total_transfer_size); + total_transfer_size, encoded_body_size); } } } @@ -889,7 +891,7 @@ // TODO(yhirano): Set |stale_copy_in_cache| appropriately if possible. client_->didFail(loader_, CreateWebURLError(request_.url(), false, net::ERR_ABORTED), - WebURLLoaderClient::kUnknownEncodedDataLength); + WebURLLoaderClient::kUnknownEncodedDataLength, 0); } // Notify the browser process that the request is canceled. @@ -955,11 +957,11 @@ OnReceivedResponse(info); auto size = data.size(); if (size != 0) - OnReceivedData( - base::MakeUnique<FixedReceivedData>(data.data(), size, 0, size)); + OnReceivedData(base::MakeUnique<FixedReceivedData>(data.data(), size, 0)); } - OnCompletedRequest(error_code, false, false, base::TimeTicks::Now(), 0); + OnCompletedRequest(error_code, false, false, base::TimeTicks::Now(), 0, + data.size()); } // WebURLLoaderImpl::RequestPeerImpl ------------------------------------------ @@ -1005,10 +1007,11 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) { + int64_t total_transfer_size, + int64_t encoded_body_size) { context_->OnCompletedRequest(error_code, was_ignored_by_handler, stale_copy_in_cache, completion_time, - total_transfer_size); + total_transfer_size, encoded_body_size); } // WebURLLoaderImpl ----------------------------------------------------------- @@ -1201,7 +1204,8 @@ WebURLResponse& response, WebURLError& error, WebData& data, - int64_t& encoded_data_length) { + int64_t& encoded_data_length, + int64_t& encoded_body_length) { TRACE_EVENT0("loading", "WebURLLoaderImpl::loadSynchronously"); SyncLoadResponse sync_load_response; context_->Start(request, &sync_load_response); @@ -1221,9 +1225,9 @@ PopulateURLResponse(final_url, sync_load_response, &response, request.reportRawHeaders()); - response.addToEncodedBodyLength(sync_load_response.encoded_body_length); response.addToDecodedBodyLength(sync_load_response.data.size()); encoded_data_length = sync_load_response.encoded_data_length; + encoded_body_length = sync_load_response.encoded_body_length; data.assign(sync_load_response.data.data(), sync_load_response.data.size()); }
diff --git a/content/child/web_url_loader_impl.h b/content/child/web_url_loader_impl.h index 2f98fab..7c55189 100644 --- a/content/child/web_url_loader_impl.h +++ b/content/child/web_url_loader_impl.h
@@ -60,7 +60,8 @@ blink::WebURLResponse& response, blink::WebURLError& error, blink::WebData& data, - int64_t& encoded_data_length) override; + int64_t& encoded_data_length, + int64_t& encoded_body_length) override; void loadAsynchronously( const blink::WebURLRequest& request, blink::WebURLLoaderClient* client) override;
diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc index 9adb126c..8772736 100644 --- a/content/child/web_url_loader_impl_unittest.cc +++ b/content/child/web_url_loader_impl_unittest.cc
@@ -190,8 +190,7 @@ void didReceiveData(blink::WebURLLoader* loader, const char* data, int dataLength, - int encodedDataLength, - int encodedBodyLength) override { + int encodedDataLength) override { EXPECT_TRUE(loader_); EXPECT_EQ(loader_.get(), loader); // The response should have started, but must not have finished, or failed. @@ -214,7 +213,8 @@ void didFinishLoading(blink::WebURLLoader* loader, double finishTime, - int64_t totalEncodedDataLength) override { + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) override { EXPECT_TRUE(loader_); EXPECT_EQ(loader_.get(), loader); EXPECT_TRUE(did_receive_response_); @@ -227,7 +227,8 @@ void didFail(blink::WebURLLoader* loader, const blink::WebURLError& error, - int64_t totalEncodedDataLength) override { + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) override { EXPECT_TRUE(loader_); EXPECT_EQ(loader_.get(), loader); EXPECT_FALSE(did_finish_); @@ -337,14 +338,14 @@ EXPECT_EQ("", client()->received_data()); auto size = strlen(kTestData); peer()->OnReceivedData( - base::MakeUnique<FixedReceivedData>(kTestData, size, size, size)); + base::MakeUnique<FixedReceivedData>(kTestData, size, size)); EXPECT_EQ(kTestData, client()->received_data()); } void DoCompleteRequest() { EXPECT_FALSE(client()->did_finish()); peer()->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), - strlen(kTestData)); + strlen(kTestData), strlen(kTestData)); EXPECT_TRUE(client()->did_finish()); // There should be no error. EXPECT_EQ(net::OK, client()->error().reason); @@ -353,8 +354,8 @@ void DoFailRequest() { EXPECT_FALSE(client()->did_finish()); - peer()->OnCompletedRequest(net::ERR_FAILED, false, false, - base::TimeTicks(), strlen(kTestData)); + peer()->OnCompletedRequest(net::ERR_FAILED, false, false, base::TimeTicks(), + strlen(kTestData), strlen(kTestData)); EXPECT_FALSE(client()->did_finish()); EXPECT_EQ(net::ERR_FAILED, client()->error().reason); EXPECT_EQ(net::kErrorDomain, client()->error().domain.utf8()); @@ -371,7 +372,7 @@ void DoReceiveDataFtp() { auto size = strlen(kFtpDirListing); peer()->OnReceivedData( - base::MakeUnique<FixedReceivedData>(kFtpDirListing, size, size, size)); + base::MakeUnique<FixedReceivedData>(kFtpDirListing, size, size)); // The FTP delegate should modify the data the client sees. EXPECT_NE(kFtpDirListing, client()->received_data()); } @@ -594,7 +595,7 @@ // cancel in DoReceiveDataFtp, before the request finishes. client()->set_delete_on_receive_data(); peer()->OnCompletedRequest(net::OK, false, false, base::TimeTicks(), - strlen(kTestData)); + strlen(kTestData), strlen(kTestData)); EXPECT_FALSE(client()->did_finish()); } @@ -704,14 +705,12 @@ blink::WebURLError error; blink::WebData data; int64_t encoded_data_length = 0; - client()->loader()->loadSynchronously(request, response, error, data, - encoded_data_length); + int64_t encoded_body_length = 0; + client()->loader()->loadSynchronously( + request, response, error, data, encoded_data_length, encoded_body_length); - EXPECT_EQ(kEncodedBodyLength, response.encodedBodyLengthForTesting()); + EXPECT_EQ(kEncodedBodyLength, encoded_body_length); EXPECT_EQ(kEncodedDataLength, encoded_data_length); - int expected_decoded_body_length = strlen(kBodyData); - EXPECT_EQ(expected_decoded_body_length, - response.decodedBodyLengthForTesting()); } } // namespace
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h index 5b23e55d..50c828f 100644 --- a/content/common/resource_messages.h +++ b/content/common/resource_messages.h
@@ -309,21 +309,19 @@ // Sent when a chunk of data from a resource request is ready, and the resource // is expected to be small enough to fit in the inlined buffer. // The data is sent as a part of IPC message. -IPC_MESSAGE_CONTROL4(ResourceMsg_InlinedDataChunkReceived, +IPC_MESSAGE_CONTROL3(ResourceMsg_InlinedDataChunkReceived, int /* request_id */, std::vector<char> /* data */, - int /* encoded_data_length */, - int /* encoded_body_length */) + int /* encoded_data_length */) // Sent when some data from a resource request is ready. The data offset and // length specify a byte range into the shared memory buffer provided by the // SetDataBuffer message. -IPC_MESSAGE_CONTROL5(ResourceMsg_DataReceived, +IPC_MESSAGE_CONTROL4(ResourceMsg_DataReceived, int /* request_id */, int /* data_offset */, int /* data_length */, - int /* encoded_data_length */, - int /* encoded_body_length */) + int /* encoded_data_length */) // Sent when some data from a resource request has been downloaded to // file. This is only called in the 'download_to_file' case and replaces
diff --git a/content/public/child/fixed_received_data.cc b/content/public/child/fixed_received_data.cc index 7e02e134..5af40b2ce 100644 --- a/content/public/child/fixed_received_data.cc +++ b/content/public/child/fixed_received_data.cc
@@ -8,24 +8,17 @@ FixedReceivedData::FixedReceivedData(const char* data, size_t length, - int encoded_data_length, - int encoded_body_length) - : data_(data, data + length), - encoded_data_length_(encoded_data_length), - encoded_body_length_(encoded_body_length) {} + int encoded_data_length) + : data_(data, data + length), encoded_data_length_(encoded_data_length) {} FixedReceivedData::FixedReceivedData(ReceivedData* data) : FixedReceivedData(data->payload(), data->length(), - data->encoded_data_length(), - data->length()) {} + data->encoded_data_length()) {} FixedReceivedData::FixedReceivedData(const std::vector<char>& data, - int encoded_data_length, - int encoded_body_length) - : data_(data), - encoded_data_length_(encoded_data_length), - encoded_body_length_(encoded_body_length) {} + int encoded_data_length) + : data_(data), encoded_data_length_(encoded_data_length) {} FixedReceivedData::~FixedReceivedData() { } @@ -42,8 +35,4 @@ return encoded_data_length_; } -int FixedReceivedData::encoded_body_length() const { - return encoded_body_length_; -} - } // namespace content
diff --git a/content/public/child/fixed_received_data.h b/content/public/child/fixed_received_data.h index d9865ad..102ff36 100644 --- a/content/public/child/fixed_received_data.h +++ b/content/public/child/fixed_received_data.h
@@ -18,25 +18,18 @@ class CONTENT_EXPORT FixedReceivedData final : public RequestPeer::ThreadSafeReceivedData { public: - FixedReceivedData(const char* data, - size_t length, - int encoded_data_length, - int encoded_body_length); + FixedReceivedData(const char* data, size_t length, int encoded_data_length); explicit FixedReceivedData(ReceivedData* data); - FixedReceivedData(const std::vector<char>& data, - int encoded_data_length, - int encoded_body_length); + FixedReceivedData(const std::vector<char>& data, int encoded_data_length); ~FixedReceivedData() override; const char* payload() const override; int length() const override; int encoded_data_length() const override; - int encoded_body_length() const override; private: std::vector<char> data_; int encoded_data_length_; - int encoded_body_length_; DISALLOW_COPY_AND_ASSIGN(FixedReceivedData); };
diff --git a/content/public/child/request_peer.h b/content/public/child/request_peer.h index 706d887..3390dbea 100644 --- a/content/public/child/request_peer.h +++ b/content/public/child/request_peer.h
@@ -53,10 +53,6 @@ // different from length(), and may be smaller if the content was // compressed. -1 means this value is unavailable. virtual int encoded_data_length() const = 0; - // The encoded_body_length is the size of the body as transferred over the - // network or stored in the disk cache, excluding headers. This will be - // different from length() if a content encoding was used. - virtual int encoded_body_length() const = 0; }; // A ThreadSafeReceivedData can be deleted on ANY thread. @@ -100,7 +96,8 @@ bool was_ignored_by_handler, bool stale_copy_in_cache, const base::TimeTicks& completion_time, - int64_t total_transfer_size) = 0; + int64_t total_transfer_size, + int64_t encoded_body_size) = 0; virtual ~RequestPeer() {} };
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 69fc94b..0933f23 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -147,11 +147,6 @@ const base::Feature kPointerEvents{"PointerEvent", base::FEATURE_ENABLED_BY_DEFAULT}; -// Whether pointer event capturing follow v1 spec instead of v2 proposal. -// See https://rawgit.com/w3c/pointerevents/reduce-hit-tests/index.html. -const base::Feature kPointerEventV1SpecCapturing{ - "PointerEventV1SpecCapturing", base::FEATURE_DISABLED_BY_DEFAULT}; - // Enables purge and suspend. const base::Feature kPurgeAndSuspend{"PurgeAndSuspend", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 61dbd26..597d1b09 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -44,7 +44,6 @@ CONTENT_EXPORT extern const base::Feature kPassiveEventListenersDueToFling; CONTENT_EXPORT extern const base::Feature kPepper3DImageChromium; CONTENT_EXPORT extern const base::Feature kPointerEvents; -CONTENT_EXPORT extern const base::Feature kPointerEventV1SpecCapturing; CONTENT_EXPORT extern const base::Feature kPurgeAndSuspend; CONTENT_EXPORT extern const base::Feature kRafAlignedMouseInputEvents; CONTENT_EXPORT extern const base::Feature kRafAlignedTouchInputEvents;
diff --git a/content/public/test/test_frame_navigation_observer.cc b/content/public/test/test_frame_navigation_observer.cc index e5a19430..e16c7d9 100644 --- a/content/public/test/test_frame_navigation_observer.cc +++ b/content/public/test/test_frame_navigation_observer.cc
@@ -33,7 +33,8 @@ navigation_started_(false), has_committed_(false), wait_for_commit_(false), - message_loop_runner_(new MessageLoopRunner) { + message_loop_runner_( + new MessageLoopRunner(MessageLoopRunner::QuitMode::IMMEDIATE)) { DCHECK_CURRENTLY_ON(BrowserThread::UI); }
diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc index cc8757d..a19a31d 100644 --- a/content/public/test/test_utils.cc +++ b/content/public/test/test_utils.cc
@@ -208,9 +208,8 @@ } #endif -MessageLoopRunner::MessageLoopRunner() - : loop_running_(false), - quit_closure_called_(false) { +MessageLoopRunner::MessageLoopRunner(QuitMode quit_mode) + : quit_mode_(quit_mode), loop_running_(false), quit_closure_called_(false) { } MessageLoopRunner::~MessageLoopRunner() = default; @@ -239,7 +238,14 @@ // Only run the quit task if we are running the message loop. if (loop_running_) { - GetQuitTaskForRunLoop(&run_loop_).Run(); + switch (quit_mode_) { + case QuitMode::DEFERRED: + GetQuitTaskForRunLoop(&run_loop_).Run(); + break; + case QuitMode::IMMEDIATE: + run_loop_.Quit(); + break; + } loop_running_ = false; } }
diff --git a/content/public/test/test_utils.h b/content/public/test/test_utils.h index d479eb5..e6bbc562 100644 --- a/content/public/test/test_utils.h +++ b/content/public/test/test_utils.h
@@ -89,9 +89,19 @@ // Helper class to Run and Quit the message loop. Run and Quit can only happen // once per instance. Make a new instance for each use. Calling Quit after Run // has returned is safe and has no effect. +// Note that by default Quit does not quit immediately. If that is not what you +// really need, pass QuitMode::IMMEDIATE in the constructor. class MessageLoopRunner : public base::RefCounted<MessageLoopRunner> { public: - MessageLoopRunner(); + enum class QuitMode { + // Message loop stops after finishing the current task. + IMMEDIATE, + + // Several generations of posted tasks are executed before stopping. + DEFERRED, + }; + + MessageLoopRunner(QuitMode mode = QuitMode::DEFERRED); // Run the current MessageLoop unless the quit closure // has already been called. @@ -113,6 +123,8 @@ friend class base::RefCounted<MessageLoopRunner>; ~MessageLoopRunner(); + QuitMode quit_mode_; + // True when the message loop is running. bool loop_running_;
diff --git a/content/renderer/fetchers/resource_fetcher_impl.cc b/content/renderer/fetchers/resource_fetcher_impl.cc index 23aab93e..8331689 100644 --- a/content/renderer/fetchers/resource_fetcher_impl.cc +++ b/content/renderer/fetchers/resource_fetcher_impl.cc
@@ -86,8 +86,7 @@ void didReceiveData(blink::WebURLLoader* loader, const char* data, int data_length, - int encoded_data_length, - int encoded_body_length) override { + int encoded_data_length) override { DCHECK(!completed_); DCHECK_GT(data_length, 0); @@ -95,14 +94,16 @@ } void didFinishLoading(blink::WebURLLoader* loader, double finishTime, - int64_t total_encoded_data_length) override { + int64_t total_encoded_data_length, + int64_t total_encoded_body_length) override { DCHECK(!completed_); OnLoadCompleteInternal(LOAD_SUCCEEDED); } void didFail(blink::WebURLLoader* loader, const blink::WebURLError& error, - int64_t total_encoded_data_length) override { + int64_t total_encoded_data_length, + int64_t total_encoded_body_length) override { OnLoadCompleteInternal(LOAD_FAILED); }
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index f517017..ac2526e 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -238,7 +238,7 @@ "//ipc:test_support", "//media", "//media/capture", - "//media/mojo/interfaces:image_capture", + "//media/capture/mojo:image_capture", "//mojo/edk/system", "//mojo/edk/test:test_support", "//net:test_support",
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc index f7fcfe4..3924395 100644 --- a/content/test/content_browser_test_utils_internal.cc +++ b/content/test/content_browser_test_utils_internal.cc
@@ -379,7 +379,9 @@ ->GetAsWebContents()), frame_tree_node_id_(frame_tree_node->frame_tree_node_id()), url_(url), - message_loop_runner_(new MessageLoopRunner) {} + message_loop_runner_( + new MessageLoopRunner(MessageLoopRunner::QuitMode::IMMEDIATE)) { +} UrlCommitObserver::~UrlCommitObserver() {}
diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc index e677bcf..544e6249 100644 --- a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc +++ b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc
@@ -533,7 +533,7 @@ // Total calories burned in kJoules since the last reset. Increment this by 1 // every time. It's fine if it overflows: it becomes 0 when the user resets - // the heart rate monitor (or pretend that he had a lot of cheeseburgers). + // the heart rate monitor (or pretend that they had a lot of cheeseburgers). value.energy_expanded = calories_burned_++; // Include one RR-Interval value, in seconds.
diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc index 359507c..e03c98d 100644 --- a/extensions/browser/extension_function.cc +++ b/extensions/browser/extension_function.cc
@@ -271,7 +271,6 @@ user_gesture_(false), bad_message_(false), histogram_value_(extensions::functions::UNKNOWN), - source_tab_id_(-1), source_context_type_(Feature::UNSPECIFIED_CONTEXT), source_process_id_(-1), did_respond_(false) {}
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h index 89ac5a2d..95db5b7 100644 --- a/extensions/browser/extension_function.h +++ b/extensions/browser/extension_function.h
@@ -296,9 +296,6 @@ response_callback_ = callback; } - void set_source_tab_id(int source_tab_id) { source_tab_id_ = source_tab_id; } - int source_tab_id() const { return source_tab_id_; } - void set_source_context_type(extensions::Feature::Context type) { source_context_type_ = type; } @@ -465,9 +462,6 @@ // is invoked. extensions::functions::HistogramValue histogram_value_; - // The ID of the tab triggered this function call, or -1 if there is no tab. - int source_tab_id_; - // The type of the JavaScript context where this call originated. extensions::Feature::Context source_context_type_;
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc index 43469fb..1c5c192 100644 --- a/extensions/browser/extension_function_dispatcher.cc +++ b/extensions/browser/extension_function_dispatcher.cc
@@ -639,7 +639,6 @@ function->set_extension(extension); function->set_profile_id(profile_id); function->set_response_callback(callback); - function->set_source_tab_id(params.source_tab_id); function->set_source_context_type( process_map.GetMostLikelyContextType(extension, requesting_process_id)); function->set_source_process_id(requesting_process_id);
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h index c4d87bcf..ffbd4b5 100644 --- a/extensions/common/extension_messages.h +++ b/extensions/common/extension_messages.h
@@ -100,9 +100,6 @@ // extension. Or, they can originate from hosted apps or normal web pages. IPC_STRUCT_MEMBER(GURL, source_url) - // The id of the tab that sent this request, or -1 if there is no source tab. - IPC_STRUCT_MEMBER(int, source_tab_id) - // Unique request id to match requests and responses. IPC_STRUCT_MEMBER(int, request_id)
diff --git a/extensions/renderer/native_extension_bindings_system.cc b/extensions/renderer/native_extension_bindings_system.cc index 3a834de..6ea3f5f 100644 --- a/extensions/renderer/native_extension_bindings_system.cc +++ b/extensions/renderer/native_extension_bindings_system.cc
@@ -10,7 +10,6 @@ #include "extensions/common/extension_api.h" #include "extensions/common/extension_messages.h" #include "extensions/common/features/feature_provider.h" -#include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/script_context.h" #include "extensions/renderer/script_context_set.h" #include "gin/converter.h" @@ -180,20 +179,11 @@ else url = script_context->url(); - int tab_id = -1; - if (content::RenderFrame* render_frame = script_context->GetRenderFrame()) { - ExtensionFrameHelper* frame_helper = - ExtensionFrameHelper::Get(render_frame); - DCHECK(frame_helper); - tab_id = frame_helper->tab_id(); - } - ExtensionHostMsg_Request_Params params; params.name = request->method_name; params.arguments.Swap(request->arguments.get()); params.extension_id = script_context->GetExtensionID(); params.source_url = url; - params.source_tab_id = tab_id; params.request_id = request->request_id; params.has_callback = request->has_callback; params.user_gesture = request->has_user_gesture;
diff --git a/extensions/renderer/native_extension_bindings_system_unittest.cc b/extensions/renderer/native_extension_bindings_system_unittest.cc index 64fbeb5..a4b8556 100644 --- a/extensions/renderer/native_extension_bindings_system_unittest.cc +++ b/extensions/renderer/native_extension_bindings_system_unittest.cc
@@ -75,7 +75,6 @@ last_params_.arguments.Swap(params.arguments.CreateDeepCopy().get()); last_params_.extension_id = params.extension_id; last_params_.source_url = params.source_url; - last_params_.source_tab_id = params.source_tab_id; last_params_.request_id = params.request_id; last_params_.has_callback = params.has_callback; last_params_.user_gesture = params.user_gesture; @@ -173,7 +172,6 @@ EXPECT_EQ(extension->id(), last_params().extension_id); EXPECT_EQ("idle.queryState", last_params().name); EXPECT_EQ(extension->url(), last_params().source_url); - EXPECT_EQ(-1, last_params().source_tab_id); EXPECT_TRUE(last_params().has_callback); EXPECT_TRUE( last_params().arguments.Equals(ListValueFromString("[30]").get()));
diff --git a/extensions/renderer/request_sender.cc b/extensions/renderer/request_sender.cc index 01f054c5..896008d 100644 --- a/extensions/renderer/request_sender.cc +++ b/extensions/renderer/request_sender.cc
@@ -10,7 +10,6 @@ #include "content/public/renderer/render_frame.h" #include "extensions/common/constants.h" #include "extensions/common/extension_messages.h" -#include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/script_context.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" @@ -95,20 +94,11 @@ name, source, blink::WebUserGestureIndicator::currentUserGestureToken())); - int tab_id = -1; - if (render_frame) { - ExtensionFrameHelper* frame_helper = - ExtensionFrameHelper::Get(render_frame); - DCHECK(frame_helper); - tab_id = frame_helper->tab_id(); - } - ExtensionHostMsg_Request_Params params; params.name = name; params.arguments.Swap(value_args); params.extension_id = context->GetExtensionID(); params.source_url = source_url; - params.source_tab_id = tab_id; params.request_id = request_id; params.has_callback = has_callback; params.user_gesture =
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 9c9d392..5a59eac 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -137,7 +137,7 @@ "lib/browser/devtools_api/domain_h.template", "lib/browser/devtools_api/domain_type_conversions_h.template", "lib/browser/devtools_api/domain_types_cc.template", - "lib/browser/devtools_api/domain_types_forward_declaration_h.template", + "lib/browser/devtools_api/domain_types_forward_declarations_h.template", "lib/browser/devtools_api/domain_types_h.template", ]
diff --git a/headless/lib/browser/devtools_api/client_api_generator.py b/headless/lib/browser/devtools_api/client_api_generator.py index ce96de2..435358af 100644 --- a/headless/lib/browser/devtools_api/client_api_generator.py +++ b/headless/lib/browser/devtools_api/client_api_generator.py
@@ -494,8 +494,8 @@ # Generate forward declarations for types. GeneratePerDomain( jinja_env, os.path.join(output_dirname, 'devtools', 'internal'), - json_api, 'domain_types_forward_declaration', ['h'], - lambda domain_name: 'types_forward_declaration_%s' % (domain_name, )) + json_api, 'domain_types_forward_declarations', ['h'], + lambda domain_name: 'types_forward_declarations_%s' % (domain_name, )) # Generate types on per-domain basis. GeneratePerDomain( jinja_env, os.path.join(output_dirname, 'devtools', 'domains'),
diff --git a/headless/lib/browser/devtools_api/domain_types_forward_declaration_h.template b/headless/lib/browser/devtools_api/domain_types_forward_declarations_h.template similarity index 86% rename from headless/lib/browser/devtools_api/domain_types_forward_declaration_h.template rename to headless/lib/browser/devtools_api/domain_types_forward_declarations_h.template index 4bb223b..b321a17 100644 --- a/headless/lib/browser/devtools_api/domain_types_forward_declaration_h.template +++ b/headless/lib/browser/devtools_api/domain_types_forward_declarations_h.template
@@ -4,8 +4,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef HEADLESS_PUBLIC_DEVTOOLS_INTERNAL_TYPES_FORWARD_DECLARATION_{{domain.domain | camelcase_to_hacker_style | upper}}_H_ -#define HEADLESS_PUBLIC_DEVTOOLS_INTERNAL_TYPES_FORWARD_DECLARATION_{{domain.domain | camelcase_to_hacker_style | upper}}_H_ +#ifndef HEADLESS_PUBLIC_DEVTOOLS_INTERNAL_TYPES_FORWARD_DECLARATIONS_{{domain.domain | camelcase_to_hacker_style | upper}}_H_ +#define HEADLESS_PUBLIC_DEVTOOLS_INTERNAL_TYPES_FORWARD_DECLARATIONS_{{domain.domain | camelcase_to_hacker_style | upper}}_H_ #include "base/optional.h" #include "base/values.h" @@ -41,4 +41,4 @@ } // namespace headless -#endif // HEADLESS_PUBLIC_DEVTOOLS_INTERNAL_TYPES_FORWARD_DECLARATION_{{domain.domain | camelcase_to_hacker_style | upper}}_H_ +#endif // HEADLESS_PUBLIC_DEVTOOLS_INTERNAL_TYPES_FORWARD_DECLARATIONS_{{domain.domain | camelcase_to_hacker_style | upper}}_H_
diff --git a/headless/lib/browser/devtools_api/domain_types_h.template b/headless/lib/browser/devtools_api/domain_types_h.template index f53f8ae..b2e695ef 100644 --- a/headless/lib/browser/devtools_api/domain_types_h.template +++ b/headless/lib/browser/devtools_api/domain_types_h.template
@@ -10,7 +10,7 @@ #include "base/optional.h" #include "base/values.h" {% for domain_name in domain.dependencies %} -#include "headless/public/devtools/internal/types_forward_declaration_{{domain_name | camelcase_to_hacker_style}}.h" +#include "headless/public/devtools/internal/types_forward_declarations_{{domain_name | camelcase_to_hacker_style}}.h" {% endfor %} #include "headless/public/headless_export.h" #include "headless/public/util/error_reporter.h"
diff --git a/ios/chrome/browser/providers/BUILD.gn b/ios/chrome/browser/providers/BUILD.gn index 71616812..8b19768a 100644 --- a/ios/chrome/browser/providers/BUILD.gn +++ b/ios/chrome/browser/providers/BUILD.gn
@@ -16,6 +16,8 @@ deps = [ "//base", "//ios/chrome/browser/providers/images", + "//ios/chrome/browser/providers/signin", + "//ios/chrome/browser/providers/ui", "//ios/public/provider/chrome/browser", ] configs += [ "//build/config/compiler:enable_arc" ]
diff --git a/ios/chrome/browser/providers/chromium_browser_provider.h b/ios/chrome/browser/providers/chromium_browser_provider.h index f2a501c..5a237e6 100644 --- a/ios/chrome/browser/providers/chromium_browser_provider.h +++ b/ios/chrome/browser/providers/chromium_browser_provider.h
@@ -18,6 +18,8 @@ void SetChromeIdentityServiceForTesting( std::unique_ptr<ios::ChromeIdentityService> service) override; ios::ChromeIdentityService* GetChromeIdentityService() override; + UITextField<TextFieldStyling>* CreateStyledTextField( + CGRect frame) const override NS_RETURNS_RETAINED; void InitializeCastService(id main_tab_model) const override; void AttachTabHelpers(web::WebState* web_state, id tab) const override; VoiceSearchProvider* GetVoiceSearchProvider() const override;
diff --git a/ios/chrome/browser/providers/chromium_browser_provider.mm b/ios/chrome/browser/providers/chromium_browser_provider.mm index ab4157e20..1cd9d9f 100644 --- a/ios/chrome/browser/providers/chromium_browser_provider.mm +++ b/ios/chrome/browser/providers/chromium_browser_provider.mm
@@ -8,10 +8,11 @@ #import "ios/chrome/browser/providers/chromium_logo_controller.h" #import "ios/chrome/browser/providers/chromium_voice_search_provider.h" #import "ios/chrome/browser/providers/images/chromium_branded_image_provider.h" +#include "ios/chrome/browser/providers/signin/chromium_signin_resources_provider.h" +#include "ios/chrome/browser/providers/ui/chromium_styled_text_field.h" #include "ios/public/provider/chrome/browser/distribution/app_distribution_provider.h" #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" -#include "ios/public/provider/chrome/browser/signin/signin_resources_provider.h" #include "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -23,7 +24,7 @@ branded_image_provider_(base::MakeUnique<ChromiumBrandedImageProvider>()), signin_error_provider_(base::MakeUnique<ios::SigninErrorProvider>()), signin_resources_provider_( - base::MakeUnique<ios::SigninResourcesProvider>()), + base::MakeUnique<ChromiumSigninResourcesProvider>()), user_feedback_provider_(base::MakeUnique<UserFeedbackProvider>()), voice_search_provider_(base::MakeUnique<ChromiumVoiceSearchProvider>()) {} @@ -51,6 +52,11 @@ return chrome_identity_service_.get(); } +UITextField<TextFieldStyling>* ChromiumBrowserProvider::CreateStyledTextField( + CGRect frame) const { + return [[ChromiumStyledTextField alloc] initWithFrame:CGRectZero]; +} + void ChromiumBrowserProvider::InitializeCastService(id main_tab_model) const {} void ChromiumBrowserProvider::AttachTabHelpers(web::WebState* web_state,
diff --git a/ios/chrome/browser/providers/signin/BUILD.gn b/ios/chrome/browser/providers/signin/BUILD.gn new file mode 100644 index 0000000..f390b69 --- /dev/null +++ b/ios/chrome/browser/providers/signin/BUILD.gn
@@ -0,0 +1,17 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("signin") { + sources = [ + "chromium_signin_resources_provider.h", + "chromium_signin_resources_provider.mm", + ] + deps = [ + "//base", + "//ios/chrome/browser/ui", + "//ios/public/provider/chrome/browser", + ] + libs = [ "UIKit.framework" ] + configs += [ "//build/config/compiler:enable_arc" ] +}
diff --git a/ios/chrome/browser/providers/signin/chromium_signin_resources_provider.h b/ios/chrome/browser/providers/signin/chromium_signin_resources_provider.h new file mode 100644 index 0000000..85fc8212 --- /dev/null +++ b/ios/chrome/browser/providers/signin/chromium_signin_resources_provider.h
@@ -0,0 +1,26 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_PROVIDERS_SIGNIN_CHROMIUM_SIGNIN_RESOURCES_PROVIDER_H_ +#define IOS_CHROME_BROWSER_PROVIDERS_SIGNIN_CHROMIUM_SIGNIN_RESOURCES_PROVIDER_H_ + +#include "base/macros.h" +#include "ios/public/provider/chrome/browser/signin/signin_resources_provider.h" + +// ChromiumSigninResourcesProvider provides resources that the app expects to +// exist, even when signin is disabled. +class ChromiumSigninResourcesProvider : public ios::SigninResourcesProvider { + public: + ChromiumSigninResourcesProvider(); + ~ChromiumSigninResourcesProvider() override; + + // SigninResourcesProvider implementation: + UIImage* GetDefaultAvatar() override; + NSString* GetLocalizedString(ios::SigninStringID string_id) override; + + private: + DISALLOW_COPY_AND_ASSIGN(ChromiumSigninResourcesProvider); +}; + +#endif // IOS_CHROME_BROWSER_PROVIDERS_SIGNIN_CHROMIUM_SIGNIN_RESOURCES_PROVIDER_H_
diff --git a/ios/chrome/browser/providers/signin/chromium_signin_resources_provider.mm b/ios/chrome/browser/providers/signin/chromium_signin_resources_provider.mm new file mode 100644 index 0000000..49c6e021f --- /dev/null +++ b/ios/chrome/browser/providers/signin/chromium_signin_resources_provider.mm
@@ -0,0 +1,27 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/providers/signin/chromium_signin_resources_provider.h" + +#import <UIKit/UIKit.h> + +#import "ios/chrome/browser/ui/uikit_ui_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +ChromiumSigninResourcesProvider::ChromiumSigninResourcesProvider() {} +ChromiumSigninResourcesProvider::~ChromiumSigninResourcesProvider() {} + +// The signin code expects to receive a non-nil response to this method, even +// though signin is not supported by Chromium builds. +UIImage* ChromiumSigninResourcesProvider::GetDefaultAvatar() { + return ImageWithColor([UIColor lightGrayColor]); +} + +NSString* ChromiumSigninResourcesProvider::GetLocalizedString( + ios::SigninStringID string_id) { + return @""; +}
diff --git a/ios/chrome/browser/providers/ui/BUILD.gn b/ios/chrome/browser/providers/ui/BUILD.gn new file mode 100644 index 0000000..2bfc848 --- /dev/null +++ b/ios/chrome/browser/providers/ui/BUILD.gn
@@ -0,0 +1,16 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("ui") { + sources = [ + "chromium_styled_text_field.h", + "chromium_styled_text_field.mm", + ] + deps = [ + "//base", + "//ios/public/provider/chrome/browser", + ] + libs = [ "UIKit.framework" ] + configs += [ "//build/config/compiler:enable_arc" ] +}
diff --git a/ios/chrome/browser/providers/ui/chromium_styled_text_field.h b/ios/chrome/browser/providers/ui/chromium_styled_text_field.h new file mode 100644 index 0000000..a25d323 --- /dev/null +++ b/ios/chrome/browser/providers/ui/chromium_styled_text_field.h
@@ -0,0 +1,18 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_PROVIDERS_UI_CHROMIUM_STYLED_TEXT_FIELD_H_ +#define IOS_CHROME_BROWSER_PROVIDERS_UI_CHROMIUM_STYLED_TEXT_FIELD_H_ + +#import "ios/public/provider/chrome/browser/ui/text_field_styling.h" + +#import <UIKit/UIKit.h> + +// ChromiumStyledTextField does not style the text field or perform text +// validation, but it provides a barebones implementation of the +// TextFieldStyling protocol for use in Chromium builds. +@interface ChromiumStyledTextField : UITextField<TextFieldStyling> +@end + +#endif // IOS_CHROME_BROWSER_PROVIDERS_UI_CHROMIUM_STYLED_TEXT_FIELD_H_
diff --git a/ios/chrome/browser/providers/ui/chromium_styled_text_field.mm b/ios/chrome/browser/providers/ui/chromium_styled_text_field.mm new file mode 100644 index 0000000..0af91e3 --- /dev/null +++ b/ios/chrome/browser/providers/ui/chromium_styled_text_field.mm
@@ -0,0 +1,17 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/providers/ui/chromium_styled_text_field.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@implementation ChromiumStyledTextField +@synthesize placeholderStyle = _placeholderStyle; +@synthesize textValidator = _textValidator; + +- (void)setUseErrorStyling:(BOOL)error { +} +@end
diff --git a/media/capture/BUILD.gn b/media/capture/BUILD.gn index e2eaa98..5b1f860 100644 --- a/media/capture/BUILD.gn +++ b/media/capture/BUILD.gn
@@ -95,7 +95,7 @@ "//base", "//base:i18n", "//media", - "//media/mojo/interfaces:image_capture", + "//media/capture/mojo:image_capture", "//skia", "//third_party/libyuv", "//ui/display", @@ -176,7 +176,7 @@ "//base/test:run_all_unittests", "//base/test:test_support", "//media/base:test_support", - "//media/mojo/interfaces:image_capture", + "//media/capture/mojo:image_capture", "//testing/gmock", "//testing/gtest", "//ui/gfx:test_support",
diff --git a/media/capture/content/android/BUILD.gn b/media/capture/content/android/BUILD.gn index 3030b397..2dea9fc6 100644 --- a/media/capture/content/android/BUILD.gn +++ b/media/capture/content/android/BUILD.gn
@@ -23,7 +23,7 @@ ] deps = [ ":screen_capture_jni_headers", - "//media/mojo/interfaces:image_capture", + "//media/capture/mojo:image_capture", "//third_party/libyuv", ] }
diff --git a/media/capture/mojo/BUILD.gn b/media/capture/mojo/BUILD.gn index 8215ce7..8e9f6b6 100644 --- a/media/capture/mojo/BUILD.gn +++ b/media/capture/mojo/BUILD.gn
@@ -14,3 +14,9 @@ "//ui/gfx/geometry/mojo", ] } + +mojom("image_capture") { + sources = [ + "image_capture.mojom", + ] +}
diff --git a/media/mojo/interfaces/image_capture.mojom b/media/capture/mojo/image_capture.mojom similarity index 100% rename from media/mojo/interfaces/image_capture.mojom rename to media/capture/mojo/image_capture.mojom
diff --git a/media/capture/video/android/BUILD.gn b/media/capture/video/android/BUILD.gn index 53ca20d..5f3ba73 100644 --- a/media/capture/video/android/BUILD.gn +++ b/media/capture/video/android/BUILD.gn
@@ -27,7 +27,7 @@ ] deps = [ ":capture_jni_headers", - "//media/mojo/interfaces:image_capture", + "//media/capture/mojo:image_capture", "//third_party/libyuv", ] }
diff --git a/media/capture/video/blob_utils.h b/media/capture/video/blob_utils.h index edf53472..2f715358 100644 --- a/media/capture/video/blob_utils.h +++ b/media/capture/video/blob_utils.h
@@ -5,7 +5,7 @@ #ifndef MEDIA_CAPTURE_VIDEO_BLOB_UTILS_H_ #define MEDIA_CAPTURE_VIDEO_BLOB_UTILS_H_ -#include "media/mojo/interfaces/image_capture.mojom.h" +#include "media/capture/mojo/image_capture.mojom.h" namespace media {
diff --git a/media/capture/video/video_capture_device.h b/media/capture/video/video_capture_device.h index 000b0feb..211f4d4 100644 --- a/media/capture/video/video_capture_device.h +++ b/media/capture/video/video_capture_device.h
@@ -28,10 +28,10 @@ #include "build/build_config.h" #include "media/base/video_frame.h" #include "media/capture/capture_export.h" +#include "media/capture/mojo/image_capture.mojom.h" #include "media/capture/video/scoped_result_callback.h" #include "media/capture/video/video_capture_device_descriptor.h" #include "media/capture/video_capture_types.h" -#include "media/mojo/interfaces/image_capture.mojom.h" #include "mojo/public/cpp/bindings/array.h" #include "ui/gfx/gpu_memory_buffer.h"
diff --git a/media/mojo/interfaces/BUILD.gn b/media/mojo/interfaces/BUILD.gn index 4a003f61..4480ae62 100644 --- a/media/mojo/interfaces/BUILD.gn +++ b/media/mojo/interfaces/BUILD.gn
@@ -33,12 +33,6 @@ ] } -mojom("image_capture") { - sources = [ - "image_capture.mojom", - ] -} - mojom("remoting") { sources = [ "remoting.mojom",
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 0ab8dc5..7e96c1b6 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h
@@ -127,20 +127,11 @@ void OnThrottleUnblocked(NetworkThrottleManager::Throttle* throttle) override; private: - friend class HttpNetworkTransactionSSLTest; - - FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, - ResetStateForRestart); - FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, EnableNPN); - FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, DisableNPN); - FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, - WindowUpdateReceived); - FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, - WindowUpdateSent); - FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, - WindowUpdateOverflow); - FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, - FlowControlStallResume); + FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, ResetStateForRestart); + FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateReceived); + FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateSent); + FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateOverflow); + FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, FlowControlStallResume); FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, FlowControlStallResumeAfterSettings); FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest,
diff --git a/net/http/http_network_transaction_ssl_unittest.cc b/net/http/http_network_transaction_ssl_unittest.cc index b8636d38..1707acad 100644 --- a/net/http/http_network_transaction_ssl_unittest.cc +++ b/net/http/http_network_transaction_ssl_unittest.cc
@@ -37,36 +37,6 @@ namespace { -class TLS10SSLConfigService : public SSLConfigService { - public: - TLS10SSLConfigService() { - ssl_config_.version_min = SSL_PROTOCOL_VERSION_TLS1; - ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1; - } - - void GetSSLConfig(SSLConfig* config) override { *config = ssl_config_; } - - private: - ~TLS10SSLConfigService() override {} - - SSLConfig ssl_config_; -}; - -class TLS12SSLConfigService : public SSLConfigService { - public: - TLS12SSLConfigService() { - ssl_config_.version_min = SSL_PROTOCOL_VERSION_TLS1; - ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1_2; - } - - void GetSSLConfig(SSLConfig* config) override { *config = ssl_config_; } - - private: - ~TLS12SSLConfigService() override {} - - SSLConfig ssl_config_; -}; - class TokenBindingSSLConfigService : public SSLConfigService { public: TokenBindingSSLConfigService() { @@ -86,7 +56,7 @@ class HttpNetworkTransactionSSLTest : public testing::Test { protected: void SetUp() override { - ssl_config_service_ = new TLS10SSLConfigService; + ssl_config_service_ = new TokenBindingSSLConfigService; session_params_.ssl_config_service = ssl_config_service_.get(); auth_handler_factory_.reset(new HttpAuthHandlerMock::Factory()); @@ -112,10 +82,6 @@ return request_info; } - SSLConfig& GetServerSSLConfig(HttpNetworkTransaction* trans) { - return trans->server_ssl_config_; - } - scoped_refptr<SSLConfigService> ssl_config_service_; std::unique_ptr<HttpAuthHandlerMock::Factory> auth_handler_factory_; std::unique_ptr<ProxyService> proxy_service_; @@ -133,8 +99,6 @@ #if !defined(OS_IOS) TEST_F(HttpNetworkTransactionSSLTest, TokenBinding) { - ssl_config_service_ = new TokenBindingSSLConfigService; - session_params_.ssl_config_service = ssl_config_service_.get(); ChannelIDService channel_id_service(new DefaultChannelIDStore(NULL), base::ThreadTaskRunnerHandle::Get()); session_params_.channel_id_service = &channel_id_service; @@ -185,8 +149,6 @@ } TEST_F(HttpNetworkTransactionSSLTest, NoTokenBindingOverHttp) { - ssl_config_service_ = new TokenBindingSSLConfigService; - session_params_.ssl_config_service = ssl_config_service_.get(); ChannelIDService channel_id_service(new DefaultChannelIDStore(NULL), base::ThreadTaskRunnerHandle::Get()); session_params_.channel_id_service = &channel_id_service; @@ -218,9 +180,6 @@ // Regression test for https://crbug.com/667683. TEST_F(HttpNetworkTransactionSSLTest, TokenBindingAsync) { - ssl_config_service_ = new TokenBindingSSLConfigService; - session_params_.ssl_config_service = ssl_config_service_.get(); - // Create a separate thread for ChannelIDService // so that asynchronous Channel ID creation can be delayed. base::Thread channel_id_thread("ThreadForChannelIDService");
diff --git a/net/quic/core/quic_stream_sequencer_buffer.cc b/net/quic/core/quic_stream_sequencer_buffer.cc index e6bd911..db4abf9 100644 --- a/net/quic/core/quic_stream_sequencer_buffer.cc +++ b/net/quic/core/quic_stream_sequencer_buffer.cc
@@ -50,12 +50,17 @@ blocks_count_( ceil(static_cast<double>(max_capacity_bytes) / kBlockSizeBytes)), total_bytes_read_(0), - blocks_(nullptr) { + blocks_(nullptr), + destruction_indicator_(123456) { + CHECK_GT(blocks_count_, 1u) + << "blocks_count_ = " << blocks_count_ + << ", max_buffer_capacity_bytes_ = " << max_buffer_capacity_bytes_; Clear(); } QuicStreamSequencerBuffer::~QuicStreamSequencerBuffer() { Clear(); + destruction_indicator_ = 654321; } void QuicStreamSequencerBuffer::Clear() { @@ -92,6 +97,7 @@ QuicTime timestamp, size_t* const bytes_buffered, std::string* error_details) { + CHECK_EQ(destruction_indicator_, 123456) << "This object has been destructed"; *bytes_buffered = 0; QuicStreamOffset offset = starting_offset; size_t size = data.size(); @@ -273,9 +279,12 @@ size_t dest_count, size_t* bytes_read, string* error_details) { + CHECK_EQ(destruction_indicator_, 123456) << "This object has been destructed"; + *bytes_read = 0; for (size_t i = 0; i < dest_count && ReadableBytes() > 0; ++i) { char* dest = reinterpret_cast<char*>(dest_iov[i].iov_base); + CHECK_NE(dest, nullptr); size_t dest_remaining = dest_iov[i].iov_len; while (dest_remaining > 0 && ReadableBytes() > 0) { size_t block_idx = NextBlockToRead(); @@ -329,6 +338,8 @@ int QuicStreamSequencerBuffer::GetReadableRegions(struct iovec* iov, int iov_count) const { + CHECK_EQ(destruction_indicator_, 123456) << "This object has been destructed"; + DCHECK(iov != nullptr); DCHECK_GT(iov_count, 0); @@ -387,6 +398,8 @@ bool QuicStreamSequencerBuffer::GetReadableRegion(iovec* iov, QuicTime* timestamp) const { + CHECK_EQ(destruction_indicator_, 123456) << "This object has been destructed"; + if (ReadableBytes() == 0) { iov[0].iov_base = nullptr; iov[0].iov_len = 0; @@ -425,6 +438,8 @@ } bool QuicStreamSequencerBuffer::MarkConsumed(size_t bytes_used) { + CHECK_EQ(destruction_indicator_, 123456) << "This object has been destructed"; + if (bytes_used > ReadableBytes()) { return false; }
diff --git a/net/quic/core/quic_stream_sequencer_buffer.h b/net/quic/core/quic_stream_sequencer_buffer.h index 9549d1f..6ce341d 100644 --- a/net/quic/core/quic_stream_sequencer_buffer.h +++ b/net/quic/core/quic_stream_sequencer_buffer.h
@@ -248,6 +248,11 @@ // Stores all the buffered frames' start offset, length and arrival time. std::map<QuicStreamOffset, FrameInfo> frame_arrival_time_map_; + // For debugging use after free, assigned to 123456 in constructor and 654321 + // in destructor. As long as it's not 123456, this means either use after free + // or memory corruption. + int32_t destruction_indicator_; + DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencerBuffer); }; } // namespace net
diff --git a/net/quic/core/quic_stream_sequencer_buffer_test.cc b/net/quic/core/quic_stream_sequencer_buffer_test.cc index bc3025d..919da24 100644 --- a/net/quic/core/quic_stream_sequencer_buffer_test.cc +++ b/net/quic/core/quic_stream_sequencer_buffer_test.cc
@@ -332,26 +332,6 @@ EXPECT_TRUE(helper_->CheckBufferInvariants()); } -TEST_F(QuicStreamSequencerBufferTest, ReadvError) { - string source = string(100, 'b'); - clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1)); - QuicTime t1 = clock_.ApproximateNow(); - // Write something into [0, 100). - size_t written; - buffer_->OnStreamData(0, source, t1, &written, &error_details_); - EXPECT_TRUE(helper_->GetBlock(0) != nullptr); - EXPECT_TRUE(buffer_->HasBytesToRead()); - // Read into a iovec array with total capacity of 120 bytes. - iovec iov{nullptr, 120}; - size_t read; - EXPECT_EQ(QUIC_STREAM_SEQUENCER_INVALID_STATE, - buffer_->Readv(&iov, 1, &read, &error_details_)); - EXPECT_EQ(0u, - error_details_.find( - "QuicStreamSequencerBuffer error: Readv() dest == nullptr: true" - " blocks_[0] == nullptr: false")); -} - TEST_F(QuicStreamSequencerBufferTest, ReadvAcrossBlocks) { string source(kBlockSizeBytes + 50, 'a'); // Write 1st block to full and extand 50 bytes to next block.
diff --git a/net/quic/core/quic_stream_sequencer_test.cc b/net/quic/core/quic_stream_sequencer_test.cc index ab6a257..79db610 100644 --- a/net/quic/core/quic_stream_sequencer_test.cc +++ b/net/quic/core/quic_stream_sequencer_test.cc
@@ -659,31 +659,16 @@ EXPECT_EQ(0u, sequencer_->NumBytesBuffered()); } -// TODO(danzh): Figure out the way to implement this test case without the use -// of unsupported StringPiece constructor. -#if 0 TEST_F(QuicStreamSequencerTest, OnStreamFrameWithNullSource) { // Pass in a frame with data pointing to null address, expect to close // connection with error. - StringPiece source(nullptr, 5u); + StringPiece source; + source.set(nullptr, 5u); QuicStreamFrame frame(kClientDataStreamId1, false, 1, source); EXPECT_CALL(stream_, CloseConnectionWithDetails( QUIC_STREAM_SEQUENCER_INVALID_STATE, _)); sequencer_->OnStreamFrame(frame); } -#endif - -TEST_F(QuicStreamSequencerTest, ReadvError) { - EXPECT_CALL(stream_, OnDataAvailable()); - string source(100, 'a'); - OnFrame(0u, source.data()); - EXPECT_EQ(source.length(), sequencer_->NumBytesBuffered()); - // Pass in a null iovec, expect to tear down connection. - EXPECT_CALL(stream_, CloseConnectionWithDetails( - QUIC_STREAM_SEQUENCER_INVALID_STATE, _)); - iovec iov{nullptr, 512}; - sequencer_->Readv(&iov, 1u); -} } // namespace } // namespace test
diff --git a/net/spdy/bidirectional_stream_spdy_impl.cc b/net/spdy/bidirectional_stream_spdy_impl.cc index 3f755c1..c705343 100644 --- a/net/spdy/bidirectional_stream_spdy_impl.cc +++ b/net/spdy/bidirectional_stream_spdy_impl.cc
@@ -210,7 +210,7 @@ return stream_->GetLoadTimingInfo(load_timing_info); } -void BidirectionalStreamSpdyImpl::OnRequestHeadersSent() { +void BidirectionalStreamSpdyImpl::OnHeadersSent() { DCHECK(stream_); negotiated_protocol_ = kProtoHTTP2; @@ -218,14 +218,12 @@ delegate_->OnStreamReady(/*request_headers_sent=*/true); } -SpdyResponseHeadersStatus BidirectionalStreamSpdyImpl::OnResponseHeadersUpdated( +void BidirectionalStreamSpdyImpl::OnHeadersReceived( const SpdyHeaderBlock& response_headers) { DCHECK(stream_); if (delegate_) delegate_->OnHeadersReceived(response_headers); - - return RESPONSE_HEADERS_ARE_COMPLETE; } void BidirectionalStreamSpdyImpl::OnDataReceived( @@ -317,7 +315,7 @@ stream_->SetDelegate(this); rv = SendRequestHeadersHelper(); if (rv == OK) { - OnRequestHeadersSent(); + OnHeadersSent(); return; } else if (rv == ERR_IO_PENDING) { return;
diff --git a/net/spdy/bidirectional_stream_spdy_impl.h b/net/spdy/bidirectional_stream_spdy_impl.h index 1e3f6e7a..b5398b3 100644 --- a/net/spdy/bidirectional_stream_spdy_impl.h +++ b/net/spdy/bidirectional_stream_spdy_impl.h
@@ -61,9 +61,8 @@ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; // SpdyStream::Delegate implementation: - void OnRequestHeadersSent() override; - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override; + void OnHeadersSent() override; + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; void OnDataSent() override; void OnTrailers(const SpdyHeaderBlock& trailers) override;
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index 41389240..1fa71e1 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc
@@ -42,7 +42,7 @@ closed_stream_sent_bytes_(0), request_info_(NULL), response_info_(NULL), - response_headers_status_(RESPONSE_HEADERS_ARE_INCOMPLETE), + response_headers_complete_(false), user_buffer_len_(0), request_body_buf_size_(0), buffered_read_callback_pending_(false), @@ -105,7 +105,7 @@ CHECK(stream_.get()); // Check if we already have the response headers. If so, return synchronously. - if (response_headers_status_ == RESPONSE_HEADERS_ARE_COMPLETE) { + if (response_headers_complete_) { CHECK(!stream_->IsIdle()); return OK; } @@ -301,7 +301,7 @@ } } -void SpdyHttpStream::OnRequestHeadersSent() { +void SpdyHttpStream::OnHeadersSent() { if (HasUploadData()) { ReadAndSendRequestBodyData(); } else { @@ -309,9 +309,10 @@ } } -SpdyResponseHeadersStatus SpdyHttpStream::OnResponseHeadersUpdated( +void SpdyHttpStream::OnHeadersReceived( const SpdyHeaderBlock& response_headers) { - CHECK_EQ(response_headers_status_, RESPONSE_HEADERS_ARE_INCOMPLETE); + DCHECK(!response_headers_complete_); + response_headers_complete_ = true; if (!response_info_) { DCHECK_EQ(stream_->type(), SPDY_PUSH_STREAM); @@ -319,13 +320,11 @@ response_info_ = push_response_info_.get(); } - if (!SpdyHeadersToHttpResponse(response_headers, response_info_)) { - // We do not have complete headers yet. - return RESPONSE_HEADERS_ARE_INCOMPLETE; - } + const bool headers_valid = + SpdyHeadersToHttpResponse(response_headers, response_info_); + DCHECK(headers_valid); response_info_->response_time = stream_->response_time(); - response_headers_status_ = RESPONSE_HEADERS_ARE_COMPLETE; // Don't store the SSLInfo in the response here, HttpNetworkTransaction // will take care of that part. response_info_->was_alpn_negotiated = was_alpn_negotiated_; @@ -339,12 +338,10 @@ if (!response_callback_.is_null()) { DoResponseCallback(OK); } - - return RESPONSE_HEADERS_ARE_COMPLETE; } void SpdyHttpStream::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) { - CHECK_EQ(response_headers_status_, RESPONSE_HEADERS_ARE_COMPLETE); + DCHECK(response_headers_complete_); // Note that data may be received for a SpdyStream prior to the user calling // ReadResponseBody(), therefore user_buffer_ may be NULL. This may often
diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h index bcd2fbcc..f133090 100644 --- a/net/spdy/spdy_http_stream.h +++ b/net/spdy/spdy_http_stream.h
@@ -87,9 +87,8 @@ void SetPriority(RequestPriority priority) override; // SpdyStream::Delegate implementation. - void OnRequestHeadersSent() override; - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override; + void OnHeadersSent() override; + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; void OnDataSent() override; void OnTrailers(const SpdyHeaderBlock& trailers) override; @@ -168,9 +167,7 @@ std::unique_ptr<HttpResponseInfo> push_response_info_; - // We don't use SpdyStream's |response_header_status_| as we - // sometimes call back into our delegate before it is updated. - SpdyResponseHeadersStatus response_headers_status_; + bool response_headers_complete_; // We buffer the response body as it arrives asynchronously from the stream. SpdyReadQueue response_body_queue_;
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index f9a8aa6..cb82d444 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -4578,220 +4578,6 @@ EXPECT_TRUE(data.AllWriteDataConsumed()); } -// TODO(baranovich): HTTP 2 does not allow multiple HEADERS frames -TEST_F(SpdyNetworkTransactionTest, ServerPushWithTwoHeaderFrames) { - // We push a stream and attempt to claim it before the headers come down. - SpdySerializedFrame stream1_syn( - spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); - MockWrite writes[] = { - CreateMockWrite(stream1_syn, 0, SYNCHRONOUS), - }; - - SpdySerializedFrame stream1_reply( - spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); - - SpdyHeaderBlock initial_headers; - spdy_util_.AddUrlToHeaderBlock(GetDefaultUrlWithPath("/foo.dat"), - &initial_headers); - SpdySerializedFrame stream2_syn(spdy_util_.ConstructInitialSpdyPushFrame( - std::move(initial_headers), 2, 1)); - - SpdySerializedFrame stream1_body(spdy_util_.ConstructSpdyDataFrame(1, true)); - - SpdyHeaderBlock middle_headers; - middle_headers["hello"] = "bye"; - SpdySerializedFrame stream2_headers1(spdy_util_.ConstructSpdyResponseHeaders( - 2, std::move(middle_headers), false)); - - SpdyHeaderBlock late_headers; - late_headers[spdy_util_.GetStatusKey()] = "200"; - SpdySerializedFrame stream2_headers2(spdy_util_.ConstructSpdyResponseHeaders( - 2, std::move(late_headers), false)); - - const char kPushedData[] = "pushed"; - SpdySerializedFrame stream2_body(spdy_util_.ConstructSpdyDataFrame( - 2, kPushedData, strlen(kPushedData), true)); - - MockRead reads[] = { - CreateMockRead(stream1_reply, 1), CreateMockRead(stream2_syn, 2), - CreateMockRead(stream1_body, 3), MockRead(ASYNC, ERR_IO_PENDING, 4), - CreateMockRead(stream2_headers1, 5), - // This is needed to work around https://crbug.com/571102. - MockRead(ASYNC, ERR_IO_PENDING, 6), CreateMockRead(stream2_headers2, 7), - CreateMockRead(stream2_body, 8), MockRead(ASYNC, ERR_IO_PENDING, 9), - MockRead(ASYNC, 0, 10), // EOF - }; - - HttpResponseInfo response; - HttpResponseInfo response2; - std::string expected_push_result("pushed"); - SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes)); - - NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, - NetLogWithSource(), NULL); - helper.AddData(&data); - helper.RunPreTestSetup(); - - HttpNetworkTransaction* trans = helper.trans(); - - // Start the transaction. - TestCompletionCallback callback; - int rv = trans->Start(&CreateGetRequest(), callback.callback(), - NetLogWithSource()); - EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); - // Run until we've received the primary HEADERS, the pushed HEADERS, - // the first HEADERS frame, and the body of the primary stream, but before - // we've received the final HEADERS for the pushed stream. - data.RunUntilPaused(); - EXPECT_EQ(0, callback.WaitForResult()); - - // Request the pushed path. At this point, we've received the push, but the - // headers are not yet complete. - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session()); - rv = trans2.Start(&CreateGetPushRequest(), callback.callback(), - NetLogWithSource()); - EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); - data.Resume(); - data.RunUntilPaused(); - base::RunLoop().RunUntilIdle(); - // This is needed to work around https://crbug.com/571102. - data.Resume(); - data.RunUntilPaused(); - base::RunLoop().RunUntilIdle(); - - // Read the server push body. - std::string result2; - ReadResult(&trans2, &result2); - // Read the response body. - std::string result; - ReadResult(trans, &result); - - // Verify that the received push data is same as the expected push data. - EXPECT_EQ(expected_push_result, result2); - - // Verify the response headers. - // Copy the response info, because trans goes away. - response = *trans->GetResponseInfo(); - response2 = *trans2.GetResponseInfo(); - - VerifyStreamsClosed(helper); - - // Verify the response headers. - EXPECT_TRUE(response.headers); - EXPECT_EQ("HTTP/1.1 200", response.headers->GetStatusLine()); - - // Verify the pushed stream. - EXPECT_TRUE(response2.headers); - EXPECT_EQ("HTTP/1.1 200", response2.headers->GetStatusLine()); - - // Verify we got all the headers from all header blocks. - EXPECT_TRUE(response2.headers->HasHeaderValue("hello", "bye")); - EXPECT_TRUE(response2.headers->HasHeaderValue("status", "200")); - - // Read the final EOF (which will close the session) - data.Resume(); - base::RunLoop().RunUntilIdle(); - - // Verify that we consumed all test data. - EXPECT_TRUE(data.AllReadDataConsumed()); - EXPECT_TRUE(data.AllWriteDataConsumed()); -} - -TEST_F(SpdyNetworkTransactionTest, ServerPushWithNoStatusHeaderFrames) { - // We push a stream and attempt to claim it before the headers come down. - SpdySerializedFrame stream1_syn( - spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); - MockWrite writes[] = { - CreateMockWrite(stream1_syn, 0, SYNCHRONOUS), - }; - - SpdySerializedFrame stream1_reply( - spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); - - SpdyHeaderBlock initial_headers; - spdy_util_.AddUrlToHeaderBlock(GetDefaultUrlWithPath("/foo.dat"), - &initial_headers); - SpdySerializedFrame stream2_syn(spdy_util_.ConstructInitialSpdyPushFrame( - std::move(initial_headers), 2, 1)); - - SpdySerializedFrame stream1_body(spdy_util_.ConstructSpdyDataFrame(1, true)); - - SpdyHeaderBlock middle_headers; - middle_headers["hello"] = "bye"; - SpdySerializedFrame stream2_headers1(spdy_util_.ConstructSpdyResponseHeaders( - 2, std::move(middle_headers), false)); - - const char kPushedData[] = "pushed"; - SpdySerializedFrame stream2_body(spdy_util_.ConstructSpdyDataFrame( - 2, kPushedData, strlen(kPushedData), true)); - - MockRead reads[] = { - CreateMockRead(stream1_reply, 1), CreateMockRead(stream2_syn, 2), - CreateMockRead(stream1_body, 3), MockRead(ASYNC, ERR_IO_PENDING, 4), - CreateMockRead(stream2_headers1, 5), CreateMockRead(stream2_body, 6), - MockRead(ASYNC, ERR_IO_PENDING, 7), MockRead(ASYNC, 0, 8), // EOF - }; - - SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes)); - - NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, - NetLogWithSource(), NULL); - helper.AddData(&data); - helper.RunPreTestSetup(); - - HttpNetworkTransaction* trans = helper.trans(); - - // Start the transaction. - TestCompletionCallback callback; - int rv = trans->Start(&CreateGetRequest(), callback.callback(), - NetLogWithSource()); - EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); - // Run until we've received the primary HEADERS, the pushed HEADERS, - // the first HEADERS frame, and the body of the primary stream, but before - // we've received the final HEADERS for the pushed stream. - data.RunUntilPaused(); - EXPECT_EQ(0, callback.WaitForResult()); - - // Request the pushed path. At this point, we've received the push, but the - // headers are not yet complete. - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session()); - rv = trans2.Start(&CreateGetPushRequest(), callback.callback(), - NetLogWithSource()); - EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); - data.Resume(); - data.RunUntilPaused(); - base::RunLoop().RunUntilIdle(); - - // Read the server push body. - std::string result2; - ReadResult(&trans2, &result2); - // Read the response body. - std::string result; - ReadResult(trans, &result); - EXPECT_EQ("hello!", result); - - // Verify that we haven't received any push data. - EXPECT_EQ("", result2); - - // Verify the response headers. - // Copy the response info, because trans goes away. - HttpResponseInfo response = *trans->GetResponseInfo(); - - VerifyStreamsClosed(helper); - - // Verify the response headers. - EXPECT_TRUE(response.headers); - EXPECT_EQ("HTTP/1.1 200", response.headers->GetStatusLine()); - - // Read the final EOF (which will close the session). - data.Resume(); - base::RunLoop().RunUntilIdle(); - - // Verify that we consumed all test data. - EXPECT_TRUE(data.AllReadDataConsumed()); - EXPECT_TRUE(data.AllWriteDataConsumed()); -} - TEST_F(SpdyNetworkTransactionTest, ResponseHeadersTwice) { SpdySerializedFrame req( spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc index ea771b3c..c191446 100644 --- a/net/spdy/spdy_proxy_client_socket.cc +++ b/net/spdy/spdy_proxy_client_socket.cc
@@ -430,26 +430,26 @@ // SpdyStream::Delegate methods: // Called when SYN frame has been sent. // Returns true if no more data to be sent after SYN frame. -void SpdyProxyClientSocket::OnRequestHeadersSent() { +void SpdyProxyClientSocket::OnHeadersSent() { DCHECK_EQ(next_state_, STATE_SEND_REQUEST_COMPLETE); OnIOComplete(OK); } -SpdyResponseHeadersStatus SpdyProxyClientSocket::OnResponseHeadersUpdated( +void SpdyProxyClientSocket::OnHeadersReceived( const SpdyHeaderBlock& response_headers) { // If we've already received the reply, existing headers are too late. // TODO(mbelshe): figure out a way to make HEADERS frames useful after the // initial response. if (next_state_ != STATE_READ_REPLY_COMPLETE) - return RESPONSE_HEADERS_ARE_COMPLETE; + return; // Save the response - if (!SpdyHeadersToHttpResponse(response_headers, &response_)) - return RESPONSE_HEADERS_ARE_INCOMPLETE; + const bool headers_valid = + SpdyHeadersToHttpResponse(response_headers, &response_); + DCHECK(headers_valid); OnIOComplete(OK); - return RESPONSE_HEADERS_ARE_COMPLETE; } // Called when data is received or on EOF (if |buffer| is NULL).
diff --git a/net/spdy/spdy_proxy_client_socket.h b/net/spdy/spdy_proxy_client_socket.h index 645f5c5..f446561 100644 --- a/net/spdy/spdy_proxy_client_socket.h +++ b/net/spdy/spdy_proxy_client_socket.h
@@ -92,9 +92,8 @@ int GetLocalAddress(IPEndPoint* address) const override; // SpdyStream::Delegate implementation. - void OnRequestHeadersSent() override; - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override; + void OnHeadersSent() override; + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; void OnDataSent() override; void OnTrailers(const SpdyHeaderBlock& trailers) override;
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index dd97859..9948e2a0 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc
@@ -539,15 +539,6 @@ callback_.Reset(); } -SpdySession::ActiveStreamInfo::ActiveStreamInfo() - : stream(NULL), waiting_for_reply_headers_frame(false) {} - -SpdySession::ActiveStreamInfo::ActiveStreamInfo(SpdyStream* stream) - : stream(stream), - waiting_for_reply_headers_frame(stream->type() != SPDY_PUSH_STREAM) {} - -SpdySession::ActiveStreamInfo::~ActiveStreamInfo() {} - SpdySession::UnclaimedPushedStreamContainer::UnclaimedPushedStreamContainer( SpdySession* spdy_session) : spdy_session_(spdy_session) {} @@ -995,7 +986,7 @@ SpdyHeaderBlock block) { ActiveStreamMap::const_iterator it = active_streams_.find(stream_id); CHECK(it != active_streams_.end()); - CHECK_EQ(it->second.stream->stream_id(), stream_id); + CHECK_EQ(it->second->stream_id(), stream_id); SendPrefacePingIfNoneInFlight(); @@ -1044,7 +1035,7 @@ ActiveStreamMap::const_iterator it = active_streams_.find(stream_id); CHECK(it != active_streams_.end()); - SpdyStream* stream = it->second.stream; + SpdyStream* stream = it->second; CHECK_EQ(stream->stream_id(), stream_id); if (len < 0) { @@ -1199,7 +1190,7 @@ // TODO(mbelshe): We should send a RST_STREAM control frame here // so that the server can cancel a large send. - std::unique_ptr<SpdyStream> owned_stream(it->second.stream); + std::unique_ptr<SpdyStream> owned_stream(it->second); active_streams_.erase(it); priority_dependency_state_.OnStreamDestruction(owned_stream->stream_id()); @@ -1241,7 +1232,7 @@ // Send the RST_STREAM frame first as CloseActiveStreamIterator() // may close us. SpdyStreamId stream_id = it->first; - RequestPriority priority = it->second.stream->priority(); + RequestPriority priority = it->second->priority(); EnqueueResetStreamFrame(stream_id, priority, status, description); // Removes any pending writes for the stream except for possibly an @@ -1690,7 +1681,7 @@ void SpdySession::LogAbandonedActiveStream(ActiveStreamMap::const_iterator it, Error status) { DCHECK_GT(it->first, 0u); - LogAbandonedStream(it->second.stream, status); + LogAbandonedStream(it->second, status); ++streams_abandoned_count_; } @@ -1848,8 +1839,7 @@ SpdyStreamId stream_id = stream->stream_id(); CHECK_NE(stream_id, 0u); std::pair<ActiveStreamMap::iterator, bool> result = - active_streams_.insert( - std::make_pair(stream_id, ActiveStreamInfo(stream.get()))); + active_streams_.insert(std::make_pair(stream_id, stream.get())); CHECK(result.second); ignore_result(stream.release()); } @@ -1896,8 +1886,8 @@ net_log_.AddEvent(NetLogEventType::HTTP2_STREAM_ADOPTED_PUSH_STREAM, base::Bind(&NetLogSpdyAdoptedPushStreamCallback, - active_it->second.stream->stream_id(), &url)); - return active_it->second.stream->GetWeakPtr(); + active_it->second->stream_id(), &url)); + return active_it->second->GetWeakPtr(); } url::SchemeHostPort SpdySession::GetServer() { @@ -1967,7 +1957,7 @@ if (it == active_streams_.end()) return; - SpdyStream* stream = it->second.stream; + SpdyStream* stream = it->second; CHECK_EQ(stream->stream_id(), stream_id); DCHECK(buffered_spdy_framer_); @@ -2010,18 +2000,10 @@ if (it == active_streams_.end()) return; - SpdyStream* stream = it->second.stream; + SpdyStream* stream = it->second; CHECK_EQ(stream->stream_id(), stream_id); stream->AddRawReceivedBytes(len); - - if (it->second.waiting_for_reply_headers_frame) { - const std::string& error = "DATA received before HEADERS."; - stream->LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); - ResetStreamIterator(it, RST_STREAM_PROTOCOL_ERROR, error); - return; - } - stream->OnDataReceived(std::move(buffer)); } @@ -2045,16 +2027,9 @@ if (it == active_streams_.end()) return; - SpdyStream* stream = it->second.stream; + SpdyStream* stream = it->second; CHECK_EQ(stream->stream_id(), stream_id); - if (it->second.waiting_for_reply_headers_frame) { - const std::string& error = "DATA received before HEADERS."; - stream->LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); - ResetStreamIterator(it, RST_STREAM_PROTOCOL_ERROR, error); - return; - } - stream->OnDataReceived(std::move(buffer)); } @@ -2071,7 +2046,7 @@ ActiveStreamMap::iterator it = active_streams_.find(stream_id); if (it == active_streams_.end()) return; - it->second.stream->OnPaddingConsumed(len); + it->second->OnPaddingConsumed(len); } void SpdySession::OnSettings() { @@ -2130,41 +2105,6 @@ last_compressed_frame_len_ = frame_len; } -int SpdySession::OnInitialResponseHeadersReceived( - const SpdyHeaderBlock& response_headers, - base::Time response_time, - base::TimeTicks recv_first_byte_time, - SpdyStream* stream) { - CHECK(in_io_loop_); - SpdyStreamId stream_id = stream->stream_id(); - - if (stream->type() == SPDY_PUSH_STREAM) { - DCHECK(stream->IsReservedRemote()); - if (max_concurrent_pushed_streams_ && - num_active_pushed_streams_ >= max_concurrent_pushed_streams_) { - ResetStream(stream_id, - RST_STREAM_REFUSED_STREAM, - "Stream concurrency limit reached."); - return STATUS_CODE_REFUSED_STREAM; - } - } - - if (stream->type() == SPDY_PUSH_STREAM) { - // Will be balanced in DeleteStream. - num_active_pushed_streams_++; - } - - // May invalidate |stream|. - int rv = stream->OnInitialResponseHeadersReceived( - response_headers, response_time, recv_first_byte_time); - if (rv < 0) { - DCHECK_NE(rv, ERR_IO_PENDING); - DCHECK(active_streams_.find(stream_id) == active_streams_.end()); - } - - return rv; -} - void SpdySession::DeleteExpiredPushedStreams() { if (unclaimed_pushed_streams_.empty()) return; @@ -2190,7 +2130,7 @@ ActiveStreamMap::iterator active_it = active_streams_.find(*to_close_it); if (active_it == active_streams_.end()) continue; - bytes_pushed_and_unclaimed_count_ += active_it->second.stream->recv_bytes(); + bytes_pushed_and_unclaimed_count_ += active_it->second->recv_bytes(); LogAbandonedActiveStream(active_it, ERR_INVALID_SPDY_STREAM); // CloseActiveStreamIterator() will remove the stream from @@ -2225,29 +2165,29 @@ return; } - SpdyStream* stream = it->second.stream; + SpdyStream* stream = it->second; CHECK_EQ(stream->stream_id(), stream_id); stream->AddRawReceivedBytes(last_compressed_frame_len_); last_compressed_frame_len_ = 0; + if (it->second->IsReservedRemote()) { + DCHECK_EQ(SPDY_PUSH_STREAM, stream->type()); + if (max_concurrent_pushed_streams_ && + num_active_pushed_streams_ >= max_concurrent_pushed_streams_) { + ResetStream(stream_id, RST_STREAM_REFUSED_STREAM, + "Stream concurrency limit reached."); + return; + } + + // Will be balanced in DeleteStream. + num_active_pushed_streams_++; + } + base::Time response_time = base::Time::Now(); base::TimeTicks recv_first_byte_time = time_func_(); - - if (it->second.waiting_for_reply_headers_frame) { - it->second.waiting_for_reply_headers_frame = false; - ignore_result(OnInitialResponseHeadersReceived( - headers, response_time, recv_first_byte_time, stream)); - } else if (it->second.stream->IsReservedRemote()) { - ignore_result(OnInitialResponseHeadersReceived( - headers, response_time, recv_first_byte_time, stream)); - } else { - int rv = stream->OnAdditionalResponseHeadersReceived(headers); - if (rv < 0) { - DCHECK_NE(rv, ERR_IO_PENDING); - DCHECK(active_streams_.find(stream_id) == active_streams_.end()); - } - } + // May invalidate |stream|. + stream->OnHeadersReceived(headers, response_time, recv_first_byte_time); } void SpdySession::OnAltSvc( @@ -2278,7 +2218,7 @@ const ActiveStreamMap::iterator it = active_streams_.find(stream_id); if (it == active_streams_.end()) return; - const GURL& gurl(it->second.stream->url()); + const GURL& gurl(it->second->url()); if (!gurl.SchemeIs("https")) return; scheme_host_port = url::SchemeHostPort(gurl); @@ -2330,7 +2270,7 @@ return; } - CHECK_EQ(it->second.stream->stream_id(), stream_id); + CHECK_EQ(it->second->stream_id(), stream_id); if (status == RST_STREAM_NO_ERROR) { CloseActiveStreamIterator(it, ERR_SPDY_RST_STREAM_NO_ERROR_RECEIVED); @@ -2338,7 +2278,7 @@ CloseActiveStreamIterator(it, ERR_SPDY_SERVER_REFUSED_STREAM); } else if (status == RST_STREAM_HTTP_1_1_REQUIRED) { // TODO(bnc): Record histogram with number of open streams capped at 50. - it->second.stream->LogStreamError( + it->second->LogStreamError( ERR_HTTP_1_1_REQUIRED, base::StringPrintf( "SPDY session closed because of stream with status: %d", status)); @@ -2346,7 +2286,7 @@ } else { RecordProtocolErrorHistogram( PROTOCOL_ERROR_RST_STREAM_FOR_NON_ACTIVE_STREAM); - it->second.stream->LogStreamError( + it->second->LogStreamError( ERR_SPDY_PROTOCOL_ERROR, base::StringPrintf("SPDY stream closed with status: %d", status)); // TODO(mbelshe): Map from Spdy-protocol errors to something sensical. @@ -2440,7 +2380,7 @@ return; } - SpdyStream* stream = it->second.stream; + SpdyStream* stream = it->second; CHECK_EQ(stream->stream_id(), stream_id); if (delta_window_size < 1) { @@ -2452,12 +2392,12 @@ return; } - CHECK_EQ(it->second.stream->stream_id(), stream_id); - it->second.stream->IncreaseSendWindowSize(delta_window_size); + CHECK_EQ(it->second->stream_id(), stream_id); + it->second->IncreaseSendWindowSize(delta_window_size); } } -bool SpdySession::TryCreatePushStream(SpdyStreamId stream_id, +void SpdySession::TryCreatePushStream(SpdyStreamId stream_id, SpdyStreamId associated_stream_id, SpdyPriority priority, SpdyHeaderBlock headers) { @@ -2465,7 +2405,7 @@ if ((stream_id & 0x1) != 0) { LOG(WARNING) << "Received invalid push stream id " << stream_id; CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Odd push stream id."); - return false; + return; } // Server-initiated streams must be associated with client-initiated streams. @@ -2473,7 +2413,7 @@ LOG(WARNING) << "Received push stream id " << stream_id << " with invalid associated stream id"; CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Push on even stream id."); - return false; + return; } if (stream_id <= last_accepted_push_stream_id_) { @@ -2482,14 +2422,14 @@ CloseSessionOnError( ERR_SPDY_PROTOCOL_ERROR, "New push stream id must be greater than the last accepted."); - return false; + return; } if (IsStreamActive(stream_id)) { // We should not get here, we'll start going away earlier on // |last_seen_push_stream_id_| check. LOG(WARNING) << "Received push for active stream " << stream_id; - return false; + return; } last_accepted_push_stream_id_ = stream_id; @@ -2504,7 +2444,7 @@ request_priority, RST_STREAM_REFUSED_STREAM, "push stream request received when going away"); - return false; + return; } if (associated_stream_id == 0) { @@ -2516,7 +2456,7 @@ stream_id); EnqueueResetStreamFrame( stream_id, request_priority, RST_STREAM_REFUSED_STREAM, description); - return false; + return; } streams_pushed_count_++; @@ -2530,7 +2470,7 @@ request_priority, RST_STREAM_PROTOCOL_ERROR, "Pushed stream url was invalid: " + gurl.spec()); - return false; + return; } // Verify we have a valid stream association. @@ -2543,7 +2483,7 @@ RST_STREAM_INVALID_STREAM, base::StringPrintf("Received push for inactive associated stream %d", associated_stream_id)); - return false; + return; } DCHECK(gurl.is_valid()); @@ -2563,10 +2503,10 @@ base::StringPrintf("Rejected push of cross origin HTTPS content %d " "from trusted proxy", associated_stream_id)); - return false; + return; } } else { - GURL associated_url(associated_it->second.stream->GetUrlFromHeaders()); + GURL associated_url(associated_it->second->GetUrlFromHeaders()); if (associated_url.SchemeIs("https")) { SSLInfo ssl_info; CHECK(GetSSLInfo(&ssl_info)); @@ -2577,7 +2517,7 @@ stream_id, request_priority, RST_STREAM_REFUSED_STREAM, base::StringPrintf("Rejected push stream %d on secure connection", associated_stream_id)); - return false; + return; } } else { // TODO(bnc): Change SpdyNetworkTransactionTests to use secure sockets. @@ -2587,7 +2527,7 @@ base::StringPrintf( "Rejected cross origin push stream %d on insecure connection", associated_stream_id)); - return false; + return; } } } @@ -2603,7 +2543,7 @@ request_priority, RST_STREAM_PROTOCOL_ERROR, "Received duplicate pushed stream with url: " + gurl.spec()); - return false; + return; } std::unique_ptr<SpdyStream> stream( @@ -2614,8 +2554,7 @@ // In HTTP2 PUSH_PROMISE arrives on associated stream. if (associated_it != active_streams_.end()) { - associated_it->second.stream->AddRawReceivedBytes( - last_compressed_frame_len_); + associated_it->second->AddRawReceivedBytes(last_compressed_frame_len_); } else { stream->AddRawReceivedBytes(last_compressed_frame_len_); } @@ -2633,7 +2572,7 @@ ActiveStreamMap::iterator active_it = active_streams_.find(stream_id); if (active_it == active_streams_.end()) { NOTREACHED(); - return false; + return; } // Notify the push_delegate that a push promise has been received. @@ -2642,10 +2581,10 @@ weak_factory_.GetWeakPtr(), gurl)); } - active_it->second.stream->OnPushPromiseHeadersReceived(std::move(headers)); - DCHECK(active_it->second.stream->IsReservedRemote()); + active_it->second->OnPushPromiseHeadersReceived(std::move(headers)); + DCHECK(active_it->second->IsReservedRemote()); num_pushed_streams_++; - return true; + return; } void SpdySession::OnPushPromise(SpdyStreamId stream_id, @@ -2659,20 +2598,16 @@ &headers, stream_id, promised_stream_id)); } - // Any priority will do. - // TODO(baranovich): pass parent stream id priority? - if (!TryCreatePushStream(promised_stream_id, stream_id, 0, - std::move(headers))) - return; + // Any priority will do. TODO(baranovich): Pass parent stream id priority? + TryCreatePushStream(promised_stream_id, stream_id, 0, std::move(headers)); } void SpdySession::SendStreamWindowUpdate(SpdyStreamId stream_id, uint32_t delta_window_size) { ActiveStreamMap::const_iterator it = active_streams_.find(stream_id); CHECK(it != active_streams_.end()); - CHECK_EQ(it->second.stream->stream_id(), stream_id); - SendWindowUpdateFrame( - stream_id, delta_window_size, it->second.stream->priority()); + CHECK_EQ(it->second->stream_id(), stream_id); + SendWindowUpdateFrame(stream_id, delta_window_size, it->second->priority()); } void SpdySession::SendInitialData() { @@ -2754,7 +2689,7 @@ void SpdySession::UpdateStreamsSendWindowSize(int32_t delta_window_size) { for (ActiveStreamMap::iterator it = active_streams_.begin(); it != active_streams_.end(); ++it) { - it->second.stream->AdjustSendWindowSize(delta_window_size); + it->second->AdjustSendWindowSize(delta_window_size); } for (CreatedStreamSet::const_iterator it = created_streams_.begin(); @@ -2782,7 +2717,7 @@ RequestPriority priority) { ActiveStreamMap::const_iterator it = active_streams_.find(stream_id); if (it != active_streams_.end()) { - CHECK_EQ(it->second.stream->stream_id(), stream_id); + CHECK_EQ(it->second->stream_id(), stream_id); } else { CHECK_EQ(stream_id, kSessionFlowControlStreamId); } @@ -3058,7 +2993,7 @@ // to its own send window) but that's okay -- it'll then be // resumed once its send window increases. if (it != active_streams_.end()) - it->second.stream->PossiblyResumeIfSendStalled(); + it->second->PossiblyResumeIfSendStalled(); // The size should decrease unless we got send-stalled again. if (!IsSendStalled())
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index b7066bc8..755a1ef 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h
@@ -614,19 +614,9 @@ FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, ServerPushValidCrossOriginWithOpenSession); - typedef std::deque<base::WeakPtr<SpdyStreamRequest> > + typedef std::deque<base::WeakPtr<SpdyStreamRequest>> PendingStreamRequestQueue; - - struct ActiveStreamInfo { - ActiveStreamInfo(); - explicit ActiveStreamInfo(SpdyStream* stream); - ~ActiveStreamInfo(); - - SpdyStream* stream; - bool waiting_for_reply_headers_frame; - }; - typedef std::map<SpdyStreamId, ActiveStreamInfo> ActiveStreamMap; - + typedef std::map<SpdyStreamId, SpdyStream*> ActiveStreamMap; typedef std::set<SpdyStream*> CreatedStreamSet; enum AvailabilityState { @@ -682,7 +672,7 @@ // possible. void ProcessPendingStreamRequests(); - bool TryCreatePushStream(SpdyStreamId stream_id, + void TryCreatePushStream(SpdyStreamId stream_id, SpdyStreamId associated_stream_id, SpdyPriority priority, SpdyHeaderBlock headers); @@ -825,14 +815,6 @@ // list). Returns NULL otherwise. base::WeakPtr<SpdyStream> GetActivePushStream(const GURL& url); - // Delegates to |stream->OnInitialResponseHeadersReceived()|. If an - // error is returned, the last reference to |this| may have been - // released. - int OnInitialResponseHeadersReceived(const SpdyHeaderBlock& response_headers, - base::Time response_time, - base::TimeTicks recv_first_byte_time, - SpdyStream* stream); - void RecordPingRTTHistogram(base::TimeDelta duration); void RecordHistograms(); void RecordProtocolErrorHistogram(SpdyProtocolErrorDetails details);
diff --git a/net/spdy/spdy_session_pool_unittest.cc b/net/spdy/spdy_session_pool_unittest.cc index c981080..ebd69e8 100644 --- a/net/spdy/spdy_session_pool_unittest.cc +++ b/net/spdy/spdy_session_pool_unittest.cc
@@ -73,12 +73,9 @@ ~SessionOpeningDelegate() override {} - void OnRequestHeadersSent() override {} + void OnHeadersSent() override {} - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override { - return RESPONSE_HEADERS_ARE_COMPLETE; - } + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override {} void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override {}
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc index f8a36d9..eb6176f9 100644 --- a/net/spdy/spdy_stream.cc +++ b/net/spdy/spdy_stream.cc
@@ -59,8 +59,6 @@ } // namespace -void SpdyStream::Delegate::OnTrailers(const SpdyHeaderBlock& trailers) {} - // A wrapper around a stream that calls into ProduceHeadersFrame(). class SpdyStream::HeadersBufferProducer : public SpdyBufferProducer { public: @@ -106,7 +104,7 @@ request_headers_valid_(false), pending_send_status_(MORE_DATA_TO_SEND), request_time_(base::Time::Now()), - response_headers_status_(RESPONSE_HEADERS_ARE_INCOMPLETE), + response_state_(READY_FOR_HEADERS), io_state_(STATE_IDLE), response_status_(OK), net_log_(net_log), @@ -157,28 +155,12 @@ base::WeakPtr<SpdyStream> weak_this = GetWeakPtr(); CHECK(delegate_); - SpdyResponseHeadersStatus status = - delegate_->OnResponseHeadersUpdated(response_headers_); - if (status == RESPONSE_HEADERS_ARE_INCOMPLETE) { - // Since RESPONSE_HEADERS_ARE_INCOMPLETE was returned, we must not - // have been closed. Since we don't have complete headers, assume - // we're waiting for another HEADERS frame, and we had better not - // have any pending data frames. - CHECK(weak_this); - if (!pending_recv_data_.empty()) { - LogStreamError(ERR_SPDY_PROTOCOL_ERROR, - "Data received with incomplete headers."); - session_->CloseActiveStream(stream_id_, ERR_SPDY_PROTOCOL_ERROR); - } - return; - } + delegate_->OnHeadersReceived(response_headers_); - // OnResponseHeadersUpdated() may have closed |this|. + // OnHeadersReceived() may have closed |this|. if (!weak_this) return; - response_headers_status_ = RESPONSE_HEADERS_ARE_COMPLETE; - while (!pending_recv_data_.empty()) { // Take ownership of the first element of |pending_recv_data_|. std::unique_ptr<SpdyBuffer> buffer = std::move(pending_recv_data_.at(0)); @@ -389,83 +371,77 @@ request_time_ = t; } -int SpdyStream::OnInitialResponseHeadersReceived( - const SpdyHeaderBlock& initial_response_headers, - base::Time response_time, - base::TimeTicks recv_first_byte_time) { - // SpdySession guarantees that this is called at most once. - CHECK(response_headers_.empty()); +void SpdyStream::OnHeadersReceived(const SpdyHeaderBlock& response_headers, + base::Time response_time, + base::TimeTicks recv_first_byte_time) { + switch (response_state_) { + case READY_FOR_HEADERS: + // No header block has been received yet. + DCHECK(response_headers_.empty()); - // Check to make sure that we don't receive the response headers - // before we're ready for it. - switch (type_) { - case SPDY_BIDIRECTIONAL_STREAM: - // For a bidirectional stream, we're ready for the response - // headers once we've finished sending the request headers. - if (io_state_ == STATE_IDLE) { - session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, - "Response received before request sent"); - return ERR_SPDY_PROTOCOL_ERROR; + if (response_headers.find(":status") == response_headers.end()) { + const std::string error("Response headers do not include :status."); + LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, error); + return; } + + response_state_ = READY_FOR_DATA_OR_TRAILERS; + + switch (type_) { + case SPDY_BIDIRECTIONAL_STREAM: + case SPDY_REQUEST_RESPONSE_STREAM: + // A bidirectional stream or a request/response stream is ready for + // the response headers only after request headers are sent. + if (io_state_ == STATE_IDLE) { + const std::string error("Response received before request sent."); + LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, error); + return; + } + break; + + case SPDY_PUSH_STREAM: + // Push streams transition to a locally half-closed state upon + // headers. We must continue to buffer data while waiting for a call + // to SetDelegate() (which may not ever happen). + DCHECK_EQ(io_state_, STATE_RESERVED_REMOTE); + if (!delegate_) { + io_state_ = STATE_HALF_CLOSED_LOCAL_UNCLAIMED; + } else { + io_state_ = STATE_HALF_CLOSED_LOCAL; + } + break; + } + + DCHECK_NE(io_state_, STATE_IDLE); + + response_time_ = response_time; + recv_first_byte_time_ = recv_first_byte_time; + SaveResponseHeaders(response_headers); + break; - case SPDY_REQUEST_RESPONSE_STREAM: - // For a request/response stream, we're ready for the response - // headers once we've finished sending the request headers. - if (io_state_ == STATE_IDLE) { - session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, - "Response received before request sent"); - return ERR_SPDY_PROTOCOL_ERROR; + case READY_FOR_DATA_OR_TRAILERS: + // Second header block is trailers. + if (type_ == SPDY_PUSH_STREAM) { + const std::string error("Trailers not supported for push stream."); + LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, error); + return; } + + response_state_ = TRAILERS_RECEIVED; + delegate_->OnTrailers(response_headers); break; - case SPDY_PUSH_STREAM: - // Push streams transition to a locally half-closed state upon headers. - // We must continue to buffer data while waiting for a call to - // SetDelegate() (which may not ever happen). - CHECK_EQ(io_state_, STATE_RESERVED_REMOTE); - if (!delegate_) { - io_state_ = STATE_HALF_CLOSED_LOCAL_UNCLAIMED; - } else { - io_state_ = STATE_HALF_CLOSED_LOCAL; - } - break; + case TRAILERS_RECEIVED: + // No further header blocks are allowed after trailers. + const std::string error("Header block received after trailers."); + LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, error); + return; } - - DCHECK_NE(io_state_, STATE_IDLE); - - response_time_ = response_time; - recv_first_byte_time_ = recv_first_byte_time; - return MergeWithResponseHeaders(initial_response_headers); -} - -int SpdyStream::OnAdditionalResponseHeadersReceived( - const SpdyHeaderBlock& additional_response_headers) { - if (type_ == SPDY_REQUEST_RESPONSE_STREAM) { - if (response_headers_status_ != RESPONSE_HEADERS_ARE_COMPLETE) { - session_->ResetStream( - stream_id_, RST_STREAM_PROTOCOL_ERROR, - "Additional headers received for request/response stream"); - return ERR_SPDY_PROTOCOL_ERROR; - } - response_headers_status_ = TRAILERS_RECEIVED; - delegate_->OnTrailers(additional_response_headers); - return OK; - } - if (type_ == SPDY_BIDIRECTIONAL_STREAM) { - DCHECK_EQ(RESPONSE_HEADERS_ARE_COMPLETE, response_headers_status_); - response_headers_status_ = TRAILERS_RECEIVED; - delegate_->OnTrailers(additional_response_headers); - return OK; - } - if (type_ == SPDY_PUSH_STREAM && - response_headers_status_ == RESPONSE_HEADERS_ARE_COMPLETE) { - session_->ResetStream( - stream_id_, RST_STREAM_PROTOCOL_ERROR, - "Additional headers received for push stream"); - return ERR_SPDY_PROTOCOL_ERROR; - } - return MergeWithResponseHeaders(additional_response_headers); } void SpdyStream::OnPushPromiseHeadersReceived(SpdyHeaderBlock headers) { @@ -483,13 +459,26 @@ void SpdyStream::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) { DCHECK(session_->IsStreamActive(stream_id_)); + if (response_state_ == READY_FOR_HEADERS) { + const std::string error("DATA received before headers."); + LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, error); + return; + } + + if (response_state_ == TRAILERS_RECEIVED && buffer) { + const std::string error("DATA received after trailers."); + LogStreamError(ERR_SPDY_PROTOCOL_ERROR, error); + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, error); + return; + } + // Track our bandwidth. recv_bytes_ += buffer ? buffer->GetRemainingSize() : 0; recv_last_byte_time_ = base::TimeTicks::Now(); - // If we're still buffering data for a push stream, we will do the - // check for data received with incomplete headers in - // PushedStreamReplayData(). + // If we're still buffering data for a push stream, we will do the check for + // data received with incomplete headers in PushedStreamReplay(). if (io_state_ == STATE_HALF_CLOSED_LOCAL_UNCLAIMED) { DCHECK_EQ(type_, SPDY_PUSH_STREAM); // It should be valid for this to happen in the server push case. @@ -504,25 +493,6 @@ return; } - if (response_headers_status_ == TRAILERS_RECEIVED && buffer) { - // TRAILERS_RECEIVED is only used in SPDY_REQUEST_RESPONSE_STREAM and - // SPDY_BIDIRECTIONAL_STREAM. - DCHECK(type_ == SPDY_REQUEST_RESPONSE_STREAM || - type_ == SPDY_BIDIRECTIONAL_STREAM); - session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, - "Data received after trailers"); - return; - } - - // If we have response headers but the delegate has indicated that - // it's still incomplete, then that's a protocol error. - if (response_headers_status_ == RESPONSE_HEADERS_ARE_INCOMPLETE) { - LogStreamError(ERR_SPDY_PROTOCOL_ERROR, - "Data received with incomplete headers."); - session_->CloseActiveStream(stream_id_, ERR_SPDY_PROTOCOL_ERROR); - return; - } - CHECK(!IsClosed()); if (!buffer) { @@ -571,7 +541,7 @@ CHECK(frame_type == HEADERS || frame_type == DATA) << frame_type; int result = - (frame_type == HEADERS) ? OnRequestHeadersSent() : OnDataSent(frame_size); + (frame_type == HEADERS) ? OnHeadersSent() : OnDataSent(frame_size); if (result == ERR_IO_PENDING) { // The write operation hasn't completed yet. return; @@ -592,7 +562,7 @@ base::WeakPtr<SpdyStream> weak_this = GetWeakPtr(); write_handler_guard_ = true; if (frame_type == HEADERS) { - delegate_->OnRequestHeadersSent(); + delegate_->OnHeadersSent(); } else { delegate_->OnDataSent(); } @@ -606,7 +576,7 @@ } } -int SpdyStream::OnRequestHeadersSent() { +int SpdyStream::OnHeadersSent() { CHECK_EQ(io_state_, STATE_IDLE); CHECK_NE(stream_id_, 0u); @@ -648,7 +618,7 @@ // SpdySession is shutting down while the stream is in an intermediate state. io_state_ = STATE_CLOSED; if (status == ERR_SPDY_RST_STREAM_NO_ERROR_RECEIVED) { - if (response_headers_status_ == RESPONSE_HEADERS_ARE_INCOMPLETE) { + if (response_state_ == READY_FOR_HEADERS) { status = ERR_SPDY_PROTOCOL_ERROR; } else { status = OK; @@ -869,62 +839,31 @@ new SimpleBufferProducer(std::move(data_buffer)))); } -int SpdyStream::MergeWithResponseHeaders( - const SpdyHeaderBlock& new_response_headers) { - if (new_response_headers.find("transfer-encoding") != - new_response_headers.end()) { +void SpdyStream::SaveResponseHeaders(const SpdyHeaderBlock& response_headers) { + DCHECK(response_headers_.empty()); + if (response_headers.find("transfer-encoding") != response_headers.end()) { session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, "Received transfer-encoding header"); - return ERR_SPDY_PROTOCOL_ERROR; + return; } - for (SpdyHeaderBlock::const_iterator it = new_response_headers.begin(); - it != new_response_headers.end(); ++it) { + for (SpdyHeaderBlock::const_iterator it = response_headers.begin(); + it != response_headers.end(); ++it) { // Disallow uppercase headers. if (ContainsUppercaseAscii(it->first)) { session_->ResetStream( stream_id_, RST_STREAM_PROTOCOL_ERROR, "Upper case characters in header: " + it->first.as_string()); - return ERR_SPDY_PROTOCOL_ERROR; - } - - SpdyHeaderBlock::iterator it2 = response_headers_.find(it->first); - // Disallow duplicate headers. This is just to be conservative. - if (it2 != response_headers_.end()) { - session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, - "Duplicate header: " + it->first.as_string()); - return ERR_SPDY_PROTOCOL_ERROR; + return; } response_headers_.insert(*it); } - // If delegate_ is not yet attached, we'll call - // OnResponseHeadersUpdated() after the delegate gets attached to - // the stream. - if (delegate_) { - // The call to OnResponseHeadersUpdated() below may delete |this|, - // so use |weak_this| to detect that. - base::WeakPtr<SpdyStream> weak_this = GetWeakPtr(); - - SpdyResponseHeadersStatus status = - delegate_->OnResponseHeadersUpdated(response_headers_); - if (status == RESPONSE_HEADERS_ARE_INCOMPLETE) { - // Since RESPONSE_HEADERS_ARE_INCOMPLETE was returned, we must not - // have been closed. - CHECK(weak_this); - // Incomplete headers are OK only for push streams. - if (type_ != SPDY_PUSH_STREAM) { - session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, - "Incomplete headers"); - return ERR_INCOMPLETE_SPDY_HEADERS; - } - } else if (weak_this) { - response_headers_status_ = RESPONSE_HEADERS_ARE_COMPLETE; - } - } - - return OK; + // If delegate is not yet attached, OnHeadersReceived() will be called after + // the delegate gets attached to the stream. + if (delegate_) + delegate_->OnHeadersReceived(response_headers_); } #define STATE_CASE(s) \
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h index b2d6fbb..85982bf9 100644 --- a/net/spdy/spdy_stream.h +++ b/net/spdy/spdy_stream.h
@@ -56,18 +56,6 @@ NO_MORE_DATA_TO_SEND }; -// Returned by SpdyStream::OnResponseHeadersUpdated() to indicate -// whether the current response headers are complete or not, or whether -// trailers have been received. TRAILERS_RECEIVED denotes the state where -// headers are received after DATA frames. TRAILERS_RECEIVED is only used for -// SPDY_REQUEST_RESPONSE_STREAM, and this state also implies that the response -// headers are complete. -enum SpdyResponseHeadersStatus { - RESPONSE_HEADERS_ARE_INCOMPLETE, - RESPONSE_HEADERS_ARE_COMPLETE, - TRAILERS_RECEIVED, -}; - // The SpdyStream is used by the SpdySession to represent each stream known // on the SpdySession. This class provides interfaces for SpdySession to use. // Streams can be created either by the client or by the server. When they @@ -84,76 +72,32 @@ // Called when the request headers have been sent. Never called // for push streams. Must not cause the stream to be closed. - virtual void OnRequestHeadersSent() = 0; + virtual void OnHeadersSent() = 0; - // WARNING: This function is complicated! Be sure to read the - // whole comment below if you're working with code that implements - // or calls this function. - // - // Called when the response headers are updated from the - // server. |response_headers| contains the set of all headers - // received up to this point; delegates can assume that any - // headers previously received remain unchanged. - // - // This is called at least once before any data is received. If - // RESPONSE_HEADERS_ARE_INCOMPLETE is returned, this will be - // called again when more headers are received until - // RESPONSE_HEADERS_ARE_COMPLETE is returned, and any data - // received before then will be treated as a protocol error. - // - // If RESPONSE_HEADERS_ARE_INCOMPLETE is returned, the delegate - // must not have closed the stream. Otherwise, if - // RESPONSE_HEADERS_ARE_COMPLETE is returned, the delegate has - // processed the headers successfully. However, it still may have - // closed the stream, e.g. if the headers indicated an error - // condition. - // - // Some type-specific behavior: - // - // - For bidirectional streams, this may be called even after - // data is received, but it is expected that - // RESPONSE_HEADERS_ARE_COMPLETE is always returned. If - // RESPONSE_HEADERS_ARE_INCOMPLETE is returned, this is - // treated as a protocol error. - // - // - For request/response streams, this function is called - // exactly once before data is received, and it is expected - // that RESPONSE_HEADERS_ARE_COMPLETE is returned. If - // RESPONSE_HEADERS_ARE_INCOMPLETE is returned, this is - // treated as a protocol error. - // - // - For push streams, it is expected that this function will be - // called until RESPONSE_HEADERS_ARE_COMPLETE is returned - // before any data is received; any deviation from this is - // treated as a protocol error. - // - // TODO(jgraettinger): This should be at the semantic (HTTP) rather - // than stream layer. Streams shouldn't have a notion of header - // completeness. Move to SpdyHttpStream/SpdyWebsocketStream. - virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) = 0; + // OnHeadersReceived(), OnDataReceived(), OnTrailers(), and OnClose() + // are guaranteed to be called in the following order: + // - OnHeadersReceived() exactly once; + // - OnDataReceived() zero or more times; + // - OnTrailers() zero or one times; + // - OnClose() exactly once. - // Called when data is received after all required response - // headers have been received. |buffer| may be NULL, which signals - // EOF. Must return OK if the data was received successfully, or - // a network error code otherwise. - // + // Called when headers have been received. + virtual void OnHeadersReceived(const SpdyHeaderBlock& response_headers) = 0; + + // Called when data is received. |buffer| may be NULL, which signals EOF. // May cause the stream to be closed. virtual void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) = 0; - // Called when data is sent. Must not cause the stream to be - // closed. + // Called when data is sent. Must not cause the stream to be closed. virtual void OnDataSent() = 0; - // Called when trailers are received. Note that trailers HEADER frame will - // have END_STREAM flag set according to section 8.1 of the HTTP/2 RFC, - // so this will be followed by OnClose. + // Called when trailers are received. virtual void OnTrailers(const SpdyHeaderBlock& trailers) = 0; // Called when SpdyStream is closed. No other delegate functions // will be called after this is called, and the delegate must not // access the stream after this is called. Must not cause the - // stream to be be (re-)closed. + // stream to be (re-)closed. // // TODO(akalin): Allow this function to re-close the stream and // handle it gracefully. @@ -292,19 +236,11 @@ base::Time GetRequestTime() const; void SetRequestTime(base::Time t); - // Called at most once by the SpdySession when the initial response headers - // have been received for this stream. Returns a status code; if it is an - // error, the stream was closed by this function. - int OnInitialResponseHeadersReceived(const SpdyHeaderBlock& response_headers, - base::Time response_time, - base::TimeTicks recv_first_byte_time); - - // Called by the SpdySession (only after - // OnInitialResponseHeadersReceived() has been called) when - // late-bound headers are received for a stream. Returns a status - // code; if it is an error, the stream was closed by this function. - int OnAdditionalResponseHeadersReceived( - const SpdyHeaderBlock& additional_response_headers); + // Called by SpdySession when headers are received for this stream. May close + // the stream. + void OnHeadersReceived(const SpdyHeaderBlock& response_headers, + base::Time response_time, + base::TimeTicks recv_first_byte_time); // Called by the SpdySession when a frame carrying request headers opening a // push stream is received. Stream transits to STATE_RESERVED_REMOTE state. @@ -334,7 +270,7 @@ void OnFrameWriteComplete(SpdyFrameType frame_type, size_t frame_size); // HEADERS-specific write handler invoked by OnFrameWriteComplete(). - int OnRequestHeadersSent(); + int OnHeadersSent(); // DATA-specific write handler invoked by OnFrameWriteComplete(). // If more data is already available to be written, the next write is @@ -367,11 +303,10 @@ // Only one send can be in flight at a time, except for push // streams, which must not send anything. - // Sends the request headers. The delegate is called back via - // OnRequestHeadersSent() when the request headers have completed - // sending. |send_status| must be MORE_DATA_TO_SEND for - // bidirectional streams; for request/response streams, it must be - // MORE_DATA_TO_SEND if the request has data to upload, or + // Sends the request headers. The delegate is called back via OnHeadersSent() + // when the request headers have completed sending. |send_status| must be + // MORE_DATA_TO_SEND for bidirectional streams; for request/response streams, + // it must be MORE_DATA_TO_SEND if the request has data to upload, or // NO_MORE_DATA_TO_SEND if not. int SendRequestHeaders(SpdyHeaderBlock request_headers, SpdySendStatus send_status); @@ -455,6 +390,20 @@ STATE_CLOSED, }; + // Per RFC 7540 Section 8.1, an HTTP response consists of: + // * zero or more header blocks with informational (1xx) HTTP status, + // * one header block, + // * zero or more DATA frames, + // * zero or one header block ("trailers"). + // Each header block must have a ":status" header field. SpdyStream enforces + // these requirements, and resets the stream if they are not met. + // TODO(bnc) https://crbug.com/662197 Add support for informational headers. + enum ResponseState { + READY_FOR_HEADERS, + READY_FOR_DATA_OR_TRAILERS, + TRAILERS_RECEIVED + }; + // Update the histograms. Can safely be called repeatedly, but should only // be called after the stream has completed. void UpdateHistograms(); @@ -477,11 +426,9 @@ // |pending_send_data_| is set. void QueueNextDataFrame(); - // Merge the given headers into |response_headers_| and calls - // OnResponseHeadersUpdated() on the delegate (if attached). - // Returns a status code; if it is an error, the stream was closed - // by this function. - int MergeWithResponseHeaders(const SpdyHeaderBlock& new_response_headers); + // Saves the given headers into |response_headers_| and calls + // OnHeadersReceived() on the delegate if attached. + void SaveResponseHeaders(const SpdyHeaderBlock& response_headers); static std::string DescribeState(State state); @@ -539,7 +486,7 @@ base::Time request_time_; SpdyHeaderBlock response_headers_; - SpdyResponseHeadersStatus response_headers_status_; + ResponseState response_state_; base::Time response_time_; State io_state_;
diff --git a/net/spdy/spdy_stream_test_util.cc b/net/spdy/spdy_stream_test_util.cc index 9b250b2f..9bef50a 100644 --- a/net/spdy/spdy_stream_test_util.cc +++ b/net/spdy/spdy_stream_test_util.cc
@@ -23,12 +23,10 @@ ClosingDelegate::~ClosingDelegate() {} -void ClosingDelegate::OnRequestHeadersSent() {} +void ClosingDelegate::OnHeadersSent() {} -SpdyResponseHeadersStatus ClosingDelegate::OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) { - return RESPONSE_HEADERS_ARE_COMPLETE; -} +void ClosingDelegate::OnHeadersReceived( + const SpdyHeaderBlock& response_headers) {} void ClosingDelegate::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) {} @@ -52,17 +50,16 @@ StreamDelegateBase::~StreamDelegateBase() { } -void StreamDelegateBase::OnRequestHeadersSent() { +void StreamDelegateBase::OnHeadersSent() { stream_id_ = stream_->stream_id(); EXPECT_NE(stream_id_, 0u); send_headers_completed_ = true; } -SpdyResponseHeadersStatus StreamDelegateBase::OnResponseHeadersUpdated( +void StreamDelegateBase::OnHeadersReceived( const SpdyHeaderBlock& response_headers) { EXPECT_EQ(stream_->type() != SPDY_PUSH_STREAM, send_headers_completed_); response_headers_ = response_headers.Clone(); - return RESPONSE_HEADERS_ARE_COMPLETE; } void StreamDelegateBase::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) { @@ -121,15 +118,13 @@ StreamDelegateSendImmediate::~StreamDelegateSendImmediate() { } -SpdyResponseHeadersStatus StreamDelegateSendImmediate::OnResponseHeadersUpdated( +void StreamDelegateSendImmediate::OnHeadersReceived( const SpdyHeaderBlock& response_headers) { - SpdyResponseHeadersStatus status = - StreamDelegateBase::OnResponseHeadersUpdated(response_headers); + StreamDelegateBase::OnHeadersReceived(response_headers); if (data_.data()) { scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(data_.as_string())); stream()->SendData(buf.get(), buf->size(), MORE_DATA_TO_SEND); } - return status; } StreamDelegateWithBody::StreamDelegateWithBody( @@ -141,8 +136,8 @@ StreamDelegateWithBody::~StreamDelegateWithBody() { } -void StreamDelegateWithBody::OnRequestHeadersSent() { - StreamDelegateBase::OnRequestHeadersSent(); +void StreamDelegateWithBody::OnHeadersSent() { + StreamDelegateBase::OnHeadersSent(); stream()->SendData(buf_.get(), buf_->size(), NO_MORE_DATA_TO_SEND); } @@ -154,11 +149,9 @@ StreamDelegateCloseOnHeaders::~StreamDelegateCloseOnHeaders() { } -SpdyResponseHeadersStatus -StreamDelegateCloseOnHeaders::OnResponseHeadersUpdated( +void StreamDelegateCloseOnHeaders::OnHeadersReceived( const SpdyHeaderBlock& response_headers) { stream()->Cancel(); - return RESPONSE_HEADERS_ARE_COMPLETE; } } // namespace test
diff --git a/net/spdy/spdy_stream_test_util.h b/net/spdy/spdy_stream_test_util.h index ef3617f..0ec2b646 100644 --- a/net/spdy/spdy_stream_test_util.h +++ b/net/spdy/spdy_stream_test_util.h
@@ -27,9 +27,8 @@ ~ClosingDelegate() override; // SpdyStream::Delegate implementation. - void OnRequestHeadersSent() override; - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override; + void OnHeadersSent() override; + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; void OnDataSent() override; void OnTrailers(const SpdyHeaderBlock& trailers) override; @@ -49,9 +48,8 @@ explicit StreamDelegateBase(const base::WeakPtr<SpdyStream>& stream); ~StreamDelegateBase() override; - void OnRequestHeadersSent() override; - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override; + void OnHeadersSent() override; + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; void OnDataSent() override; void OnTrailers(const SpdyHeaderBlock& trailers) override; @@ -95,7 +93,7 @@ ~StreamDelegateDoNothing() override; }; -// Test delegate that sends data immediately in OnResponseHeadersUpdated(). +// Test delegate that sends data immediately in OnHeadersReceived(). class StreamDelegateSendImmediate : public StreamDelegateBase { public: // |data| can be NULL. @@ -103,8 +101,7 @@ base::StringPiece data); ~StreamDelegateSendImmediate() override; - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override; + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; private: base::StringPiece data_; @@ -117,21 +114,20 @@ base::StringPiece data); ~StreamDelegateWithBody() override; - void OnRequestHeadersSent() override; + void OnHeadersSent() override; private: scoped_refptr<StringIOBuffer> buf_; }; -// Test delegate that closes stream in OnResponseHeadersUpdated(). +// Test delegate that closes stream in OnHeadersReceived(). class StreamDelegateCloseOnHeaders : public StreamDelegateBase { public: explicit StreamDelegateCloseOnHeaders( const base::WeakPtr<SpdyStream>& stream); ~StreamDelegateCloseOnHeaders() override; - SpdyResponseHeadersStatus OnResponseHeadersUpdated( - const SpdyHeaderBlock& response_headers) override; + void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override; }; } // namespace test
diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc index 53452bed..64d0f8e 100644 --- a/net/spdy/spdy_stream_unittest.cc +++ b/net/spdy/spdy_stream_unittest.cc
@@ -553,8 +553,8 @@ AddWrite(req); const char* const kExtraHeaders[] = {"X-UpperCase", "yes"}; - SpdySerializedFrame reply( - spdy_util_.ConstructSpdyGetReply(kExtraHeaders, 1, 1)); + SpdySerializedFrame reply(spdy_util_.ConstructSpdyGetReply( + kExtraHeaders, arraysize(kExtraHeaders) / 2, 1)); AddRead(reply); SpdySerializedFrame rst( @@ -589,6 +589,9 @@ EXPECT_EQ(kDefaultUrl, stream->GetUrlFromHeaders().spec()); EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_SPDY_PROTOCOL_ERROR)); + + EXPECT_TRUE(data.AllWriteDataConsumed()); + EXPECT_TRUE(data.AllReadDataConsumed()); } // Receiving a header with uppercase ASCII should result in a protocol error @@ -601,9 +604,9 @@ SpdySerializedFrame reply(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); AddRead(reply); - const char* const extra_headers[] = {"X-UpperCase", "yes"}; - SpdySerializedFrame push( - spdy_util_.ConstructSpdyPush(extra_headers, 1, 2, 1, kPushUrl)); + const char* const kExtraHeaders[] = {"X-UpperCase", "yes"}; + SpdySerializedFrame push(spdy_util_.ConstructSpdyPush( + kExtraHeaders, arraysize(kExtraHeaders) / 2, 2, 1, kPushUrl)); AddRead(push); SpdySerializedFrame rst( @@ -650,11 +653,63 @@ data.Resume(); EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_CONNECTION_CLOSED)); + + EXPECT_TRUE(data.AllWriteDataConsumed()); + EXPECT_TRUE(data.AllReadDataConsumed()); } -// Receiving a header with uppercase ASCII in a HEADERS frame should result in a -// protocol error. -TEST_F(SpdyStreamTest, UpperCaseHeadersInHeadersFrame) { +TEST_F(SpdyStreamTest, HeadersMustHaveStatus) { + SpdySerializedFrame req( + spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); + AddWrite(req); + + // Response headers without ":status" header field: protocol error. + SpdyHeaderBlock header_block_without_status; + header_block_without_status[spdy_util_.GetMethodKey()] = "GET"; + header_block_without_status[spdy_util_.GetHostKey()] = "www.example.org"; + header_block_without_status[spdy_util_.GetSchemeKey()] = "https"; + header_block_without_status[spdy_util_.GetPathKey()] = "/"; + SpdySerializedFrame reply( + spdy_util_.ConstructSpdyReply(1, std::move(header_block_without_status))); + AddRead(reply); + + SpdySerializedFrame rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); + AddWrite(rst); + + AddReadEOF(); + + SequencedSocketData data(GetReads(), GetNumReads(), GetWrites(), + GetNumWrites()); + MockConnect connect_data(SYNCHRONOUS, OK); + data.set_connect_data(connect_data); + session_deps_.socket_factory->AddSocketDataProvider(&data); + + AddSSLSocketData(); + + base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); + + base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously( + SPDY_REQUEST_RESPONSE_STREAM, session, url_, LOWEST, NetLogWithSource()); + ASSERT_TRUE(stream); + + StreamDelegateDoNothing delegate(stream); + stream->SetDelegate(&delegate); + + EXPECT_TRUE(stream->GetUrlFromHeaders().is_empty()); + + SpdyHeaderBlock headers(spdy_util_.ConstructGetHeaderBlock(kDefaultUrl)); + EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers), + NO_MORE_DATA_TO_SEND)); + EXPECT_EQ(kDefaultUrl, stream->GetUrlFromHeaders().spec()); + + EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_SPDY_PROTOCOL_ERROR)); + + EXPECT_TRUE(data.AllWriteDataConsumed()); + EXPECT_TRUE(data.AllReadDataConsumed()); +} + +TEST_F(SpdyStreamTest, HeadersMustHaveStatusOnPushedStream) { SpdySerializedFrame req( spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); AddWrite(req); @@ -662,24 +717,28 @@ SpdySerializedFrame reply(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); AddRead(reply); - SpdySerializedFrame push( - spdy_util_.ConstructSpdyPush(nullptr, 0, 2, 1, kPushUrl)); - AddRead(push); + SpdySerializedFrame push_promise(spdy_util_.ConstructInitialSpdyPushFrame( + spdy_util_.ConstructGetHeaderBlock(kPushUrl), 2, 1)); + AddRead(push_promise); - AddReadPause(); - - SpdyHeaderBlock late_headers; - late_headers["X-UpperCase"] = "yes"; - SpdySerializedFrame headers_frame( - spdy_util_.ConstructSpdyReply(2, std::move(late_headers))); - AddRead(headers_frame); - - AddWritePause(); + // Response headers without ":status" header field: protocol error. + SpdyHeaderBlock header_block_without_status; + header_block_without_status[spdy_util_.GetMethodKey()] = "GET"; + header_block_without_status[spdy_util_.GetHostKey()] = "www.example.org"; + header_block_without_status[spdy_util_.GetSchemeKey()] = "https"; + header_block_without_status[spdy_util_.GetPathKey()] = "/"; + SpdySerializedFrame pushed_reply( + spdy_util_.ConstructSpdyReply(2, std::move(header_block_without_status))); + AddRead(pushed_reply); SpdySerializedFrame rst( spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); AddWrite(rst); + SpdySerializedFrame body( + spdy_util_.ConstructSpdyDataFrame(1, kPostBody, kPostBodyLength, true)); + AddRead(body); + AddReadEOF(); SequencedSocketData data(GetReads(), GetNumReads(), GetWrites(), @@ -707,30 +766,59 @@ IsError(ERR_IO_PENDING)); EXPECT_EQ(kDefaultUrl, stream->GetUrlFromHeaders().spec()); - data.RunUntilPaused(); + EXPECT_THAT(delegate.WaitForClose(), IsOk()); + EXPECT_EQ("200", delegate.GetResponseHeaderValue(spdy_util_.GetStatusKey())); + EXPECT_EQ(std::string(kPostBody, kPostBodyLength), + delegate.TakeReceivedData()); - base::WeakPtr<SpdyStream> push_stream; - EXPECT_THAT( - session->GetPushStream(GURL(kPushUrl), &push_stream, NetLogWithSource()), - IsOk()); - EXPECT_TRUE(push_stream); - - data.Resume(); - data.RunUntilPaused(); - - EXPECT_THAT( - session->GetPushStream(GURL(kPushUrl), &push_stream, NetLogWithSource()), - IsOk()); - EXPECT_FALSE(push_stream); - - data.Resume(); - - EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_CONNECTION_CLOSED)); + EXPECT_TRUE(data.AllWriteDataConsumed()); + EXPECT_TRUE(data.AllReadDataConsumed()); } -// Receiving a duplicate header in a HEADERS frame should result in a protocol -// error. -TEST_F(SpdyStreamTest, DuplicateHeaders) { +TEST_F(SpdyStreamTest, HeadersMustPreceedData) { + SpdySerializedFrame req( + spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); + AddWrite(req); + + // Response body not preceeded by headers: protocol error. + SpdySerializedFrame body( + spdy_util_.ConstructSpdyDataFrame(1, kPostBody, kPostBodyLength, true)); + AddRead(body); + + SpdySerializedFrame rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); + AddWrite(rst); + + AddReadEOF(); + + SequencedSocketData data(GetReads(), GetNumReads(), GetWrites(), + GetNumWrites()); + MockConnect connect_data(SYNCHRONOUS, OK); + data.set_connect_data(connect_data); + session_deps_.socket_factory->AddSocketDataProvider(&data); + + AddSSLSocketData(); + + base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); + + base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously( + SPDY_REQUEST_RESPONSE_STREAM, session, url_, LOWEST, NetLogWithSource()); + ASSERT_TRUE(stream); + + StreamDelegateDoNothing delegate(stream); + stream->SetDelegate(&delegate); + + EXPECT_TRUE(stream->GetUrlFromHeaders().is_empty()); + + SpdyHeaderBlock headers(spdy_util_.ConstructGetHeaderBlock(kDefaultUrl)); + EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers), + NO_MORE_DATA_TO_SEND)); + EXPECT_EQ(kDefaultUrl, stream->GetUrlFromHeaders().spec()); + + EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_SPDY_PROTOCOL_ERROR)); +} + +TEST_F(SpdyStreamTest, HeadersMustPreceedDataOnPushedStream) { SpdySerializedFrame req( spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); AddWrite(req); @@ -738,24 +826,22 @@ SpdySerializedFrame reply(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); AddRead(reply); - SpdySerializedFrame push( - spdy_util_.ConstructSpdyPush(nullptr, 0, 2, 1, kPushUrl)); - AddRead(push); + SpdySerializedFrame push_promise(spdy_util_.ConstructInitialSpdyPushFrame( + spdy_util_.ConstructGetHeaderBlock(kPushUrl), 2, 1)); + AddRead(push_promise); - AddReadPause(); - - SpdyHeaderBlock late_headers; - late_headers[spdy_util_.GetStatusKey()] = "500 Server Error"; - SpdySerializedFrame headers_frame( - spdy_util_.ConstructSpdyReply(2, std::move(late_headers))); - AddRead(headers_frame); - - AddReadPause(); + SpdySerializedFrame pushed_body( + spdy_util_.ConstructSpdyDataFrame(2, kPostBody, kPostBodyLength, true)); + AddRead(pushed_body); SpdySerializedFrame rst( spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); AddWrite(rst); + SpdySerializedFrame body( + spdy_util_.ConstructSpdyDataFrame(1, kPostBody, kPostBodyLength, true)); + AddRead(body); + AddReadEOF(); SequencedSocketData data(GetReads(), GetNumReads(), GetWrites(), @@ -783,25 +869,129 @@ IsError(ERR_IO_PENDING)); EXPECT_EQ(kDefaultUrl, stream->GetUrlFromHeaders().spec()); - data.RunUntilPaused(); + EXPECT_THAT(delegate.WaitForClose(), IsOk()); + EXPECT_EQ("200", delegate.GetResponseHeaderValue(spdy_util_.GetStatusKey())); + EXPECT_EQ(std::string(kPostBody, kPostBodyLength), + delegate.TakeReceivedData()); - base::WeakPtr<SpdyStream> push_stream; - EXPECT_THAT( - session->GetPushStream(GURL(kPushUrl), &push_stream, NetLogWithSource()), - IsOk()); - EXPECT_TRUE(push_stream); + EXPECT_TRUE(data.AllWriteDataConsumed()); + EXPECT_TRUE(data.AllReadDataConsumed()); +} - data.Resume(); - data.RunUntilPaused(); +TEST_F(SpdyStreamTest, TrailersMustNotFollowTrailers) { + SpdySerializedFrame req( + spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); + AddWrite(req); - EXPECT_THAT( - session->GetPushStream(GURL(kPushUrl), &push_stream, NetLogWithSource()), - IsOk()); - EXPECT_FALSE(push_stream); + SpdySerializedFrame reply(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); + AddRead(reply); - data.Resume(); + SpdySerializedFrame body( + spdy_util_.ConstructSpdyDataFrame(1, kPostBody, kPostBodyLength, false)); + AddRead(body); - EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_CONNECTION_CLOSED)); + SpdyHeaderBlock trailers_block; + trailers_block["foo"] = "bar"; + SpdySerializedFrame first_trailers(spdy_util_.ConstructSpdyResponseHeaders( + 1, std::move(trailers_block), false)); + AddRead(first_trailers); + + // Trailers following trailers: procotol error. + SpdySerializedFrame second_trailers(spdy_util_.ConstructSpdyResponseHeaders( + 1, std::move(trailers_block), true)); + AddRead(second_trailers); + + SpdySerializedFrame rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); + AddWrite(rst); + + AddReadEOF(); + + SequencedSocketData data(GetReads(), GetNumReads(), GetWrites(), + GetNumWrites()); + MockConnect connect_data(SYNCHRONOUS, OK); + data.set_connect_data(connect_data); + session_deps_.socket_factory->AddSocketDataProvider(&data); + + AddSSLSocketData(); + + base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); + + base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously( + SPDY_REQUEST_RESPONSE_STREAM, session, url_, LOWEST, NetLogWithSource()); + ASSERT_TRUE(stream); + + StreamDelegateDoNothing delegate(stream); + stream->SetDelegate(&delegate); + + EXPECT_TRUE(stream->GetUrlFromHeaders().is_empty()); + + SpdyHeaderBlock headers(spdy_util_.ConstructGetHeaderBlock(kDefaultUrl)); + EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers), + NO_MORE_DATA_TO_SEND)); + EXPECT_EQ(kDefaultUrl, stream->GetUrlFromHeaders().spec()); + + EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_SPDY_PROTOCOL_ERROR)); + + EXPECT_TRUE(data.AllWriteDataConsumed()); + EXPECT_TRUE(data.AllReadDataConsumed()); +} + +TEST_F(SpdyStreamTest, DataMustNotFollowTrailers) { + SpdySerializedFrame req( + spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); + AddWrite(req); + + SpdySerializedFrame reply(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); + AddRead(reply); + + SpdySerializedFrame body( + spdy_util_.ConstructSpdyDataFrame(1, kPostBody, kPostBodyLength, false)); + AddRead(body); + + SpdyHeaderBlock trailers_block; + trailers_block["foo"] = "bar"; + SpdySerializedFrame trailers(spdy_util_.ConstructSpdyResponseHeaders( + 1, std::move(trailers_block), false)); + AddRead(trailers); + + // DATA frame following trailers: protocol error. + AddRead(body); + + SpdySerializedFrame rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); + AddWrite(rst); + + AddReadEOF(); + + SequencedSocketData data(GetReads(), GetNumReads(), GetWrites(), + GetNumWrites()); + MockConnect connect_data(SYNCHRONOUS, OK); + data.set_connect_data(connect_data); + session_deps_.socket_factory->AddSocketDataProvider(&data); + + AddSSLSocketData(); + + base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); + + base::WeakPtr<SpdyStream> stream = CreateStreamSynchronously( + SPDY_REQUEST_RESPONSE_STREAM, session, url_, LOWEST, NetLogWithSource()); + ASSERT_TRUE(stream); + + StreamDelegateDoNothing delegate(stream); + stream->SetDelegate(&delegate); + + EXPECT_TRUE(stream->GetUrlFromHeaders().is_empty()); + + SpdyHeaderBlock headers(spdy_util_.ConstructGetHeaderBlock(kDefaultUrl)); + EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers), + NO_MORE_DATA_TO_SEND)); + EXPECT_EQ(kDefaultUrl, stream->GetUrlFromHeaders().spec()); + + EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_SPDY_PROTOCOL_ERROR)); + + EXPECT_TRUE(data.AllWriteDataConsumed()); + EXPECT_TRUE(data.AllReadDataConsumed()); } // Call IncreaseSendWindowSize on a stream with a large enough delta to overflow
diff --git a/remoting/protocol/webrtc_video_renderer_adapter.cc b/remoting/protocol/webrtc_video_renderer_adapter.cc index 44deb34..d237386 100644 --- a/remoting/protocol/webrtc_video_renderer_adapter.cc +++ b/remoting/protocol/webrtc_video_renderer_adapter.cc
@@ -96,7 +96,7 @@ } void WebrtcVideoRendererAdapter::OnFrame(const webrtc::VideoFrame& frame) { - if (static_cast<uint64_t>(frame.timestamp_us()) >= rtc::TimeMicros()) { + if (frame.timestamp_us() >= rtc::TimeMicros()) { // The host sets playout delay to 0, so all incoming frames are expected to // be rendered as so as they are received. LOG(WARNING) << "Received frame with playout delay greater than 0.";
diff --git a/services/ui/common/BUILD.gn b/services/ui/common/BUILD.gn index a52f23d..52c55ac 100644 --- a/services/ui/common/BUILD.gn +++ b/services/ui/common/BUILD.gn
@@ -10,8 +10,6 @@ sources = [ "event_matcher_util.cc", "event_matcher_util.h", - "generic_shared_memory_id_generator.cc", - "generic_shared_memory_id_generator.h", "switches.cc", "switches.h", "transient_window_utils.h", @@ -38,6 +36,28 @@ ] } +# GPU related code used by the server-side components (e.g. window server +# process, display compositor in the gpu process). +source_set("server_gpu") { + sources = [ + "generic_shared_memory_id_generator.cc", + "generic_shared_memory_id_generator.h", + "mus_gpu_memory_buffer_manager.cc", + "mus_gpu_memory_buffer_manager.h", + ] + + deps = [ + "//gpu/ipc/client", + ] + + public_deps = [ + "//gpu/command_buffer/client", + "//gpu/ipc/common", + "//services/ui/gpu/interfaces", + "//ui/gfx", + ] +} + source_set("run_all_service_tests") { testonly = true
diff --git a/services/ui/common/DEPS b/services/ui/common/DEPS index 7c7d468f..f30e8bd 100644 --- a/services/ui/common/DEPS +++ b/services/ui/common/DEPS
@@ -3,6 +3,7 @@ "+gpu/command_buffer", "+gpu/ipc/client", "+gpu/ipc/common", + "+services/ui/gpu/interfaces", ] specific_include_rules = {
diff --git a/services/ui/surfaces/mus_gpu_memory_buffer_manager.cc b/services/ui/common/mus_gpu_memory_buffer_manager.cc similarity index 92% rename from services/ui/surfaces/mus_gpu_memory_buffer_manager.cc rename to services/ui/common/mus_gpu_memory_buffer_manager.cc index fee5821..bdc8991 100644 --- a/services/ui/surfaces/mus_gpu_memory_buffer_manager.cc +++ b/services/ui/common/mus_gpu_memory_buffer_manager.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "services/ui/surfaces/mus_gpu_memory_buffer_manager.h" +#include "services/ui/common/mus_gpu_memory_buffer_manager.h" #include "base/logging.h" #include "gpu/ipc/client/gpu_memory_buffer_impl.h" @@ -14,11 +14,9 @@ namespace ui { MusGpuMemoryBufferManager::MusGpuMemoryBufferManager( - mojom::GpuServiceInternalPtr gpu_service, + mojom::GpuServiceInternal* gpu_service, int client_id) - : gpu_service_(std::move(gpu_service)), - client_id_(client_id), - weak_factory_(this) {} + : gpu_service_(gpu_service), client_id_(client_id), weak_factory_(this) {} MusGpuMemoryBufferManager::~MusGpuMemoryBufferManager() {}
diff --git a/services/ui/surfaces/mus_gpu_memory_buffer_manager.h b/services/ui/common/mus_gpu_memory_buffer_manager.h similarity index 84% rename from services/ui/surfaces/mus_gpu_memory_buffer_manager.h rename to services/ui/common/mus_gpu_memory_buffer_manager.h index 12694ce..cb1bd85 100644 --- a/services/ui/surfaces/mus_gpu_memory_buffer_manager.h +++ b/services/ui/common/mus_gpu_memory_buffer_manager.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SERVICES_UI_SURFACES_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ -#define SERVICES_UI_SURFACES_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ +#ifndef SERVICES_UI_COMMON_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ +#define SERVICES_UI_COMMON_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ #include <memory> @@ -18,7 +18,7 @@ // mus locally. class MusGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { public: - MusGpuMemoryBufferManager(mojom::GpuServiceInternalPtr gpu_service, + MusGpuMemoryBufferManager(mojom::GpuServiceInternal* gpu_service, int client_id); ~MusGpuMemoryBufferManager() override; @@ -36,18 +36,19 @@ const gpu::SyncToken& sync_token) override; private: - DISALLOW_COPY_AND_ASSIGN(MusGpuMemoryBufferManager); - void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id, bool is_native, const gpu::SyncToken& sync_token); - mojom::GpuServiceInternalPtr gpu_service_; + mojom::GpuServiceInternal* gpu_service_; + const int client_id_; base::WeakPtrFactory<MusGpuMemoryBufferManager> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(MusGpuMemoryBufferManager); }; } // namespace ui -#endif // SERVICES_UI_SURFACES_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ +#endif // SERVICES_UI_COMMON_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
diff --git a/services/ui/gpu/BUILD.gn b/services/ui/gpu/BUILD.gn index fc2316e6..7c73513 100644 --- a/services/ui/gpu/BUILD.gn +++ b/services/ui/gpu/BUILD.gn
@@ -27,7 +27,7 @@ "//media/gpu/ipc/service", "//mojo/public/cpp/system", "//services/service_manager/public/cpp", - "//services/ui/common:mus_common", + "//services/ui/common:server_gpu", "//services/ui/gpu/interfaces", "//services/ui/public/interfaces", "//services/ui/surfaces",
diff --git a/services/ui/gpu/gpu_service_internal.cc b/services/ui/gpu/gpu_service_internal.cc index f099c91..5681fc0 100644 --- a/services/ui/gpu/gpu_service_internal.cc +++ b/services/ui/gpu/gpu_service_internal.cc
@@ -27,8 +27,8 @@ #include "media/gpu/ipc/service/gpu_video_encode_accelerator.h" #include "media/gpu/ipc/service/media_gpu_channel_manager.h" #include "mojo/public/cpp/bindings/strong_binding.h" +#include "services/ui/common/mus_gpu_memory_buffer_manager.h" #include "services/ui/surfaces/display_compositor.h" -#include "services/ui/surfaces/mus_gpu_memory_buffer_manager.h" #include "ui/gl/gl_implementation.h" #include "ui/gl/gl_switches.h" #include "ui/gl/gpu_switching_manager.h" @@ -114,14 +114,13 @@ cc::mojom::DisplayCompositorRequest request, cc::mojom::DisplayCompositorClientPtrInfo client_info) { DCHECK(compositor_runner_->BelongsToCurrentThread()); - mojom::GpuServiceInternalPtr gpu_service_ptr; - gpu_service_ptr.Bind(std::move(gpu_service_info)); + gpu_internal_.Bind(std::move(gpu_service_info)); cc::mojom::DisplayCompositorClientPtr client_ptr; client_ptr.Bind(std::move(client_info)); std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager = - base::MakeUnique<MusGpuMemoryBufferManager>(std::move(gpu_service_ptr), + base::MakeUnique<MusGpuMemoryBufferManager>(gpu_internal_.get(), 1 /* client_id */); // |gpu_memory_buffer_factory_| is null in tests. gpu::ImageFactory* image_factory = @@ -146,6 +145,7 @@ void GpuServiceInternal::DestroyDisplayCompositorOnCompositorThread() { display_compositor_.reset(); + gpu_internal_.reset(); } void GpuServiceInternal::DidCreateOffscreenContext(const GURL& active_url) {
diff --git a/services/ui/gpu/gpu_service_internal.h b/services/ui/gpu/gpu_service_internal.h index cbee07d..ca199970 100644 --- a/services/ui/gpu/gpu_service_internal.h +++ b/services/ui/gpu/gpu_service_internal.h
@@ -132,6 +132,10 @@ std::unique_ptr<ui::DisplayCompositor> display_compositor_; + // The message-pipe used by the DisplayCompositor to request gpu memory + // buffers. + mojom::GpuServiceInternalPtr gpu_internal_; + scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_command_service_; std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_; std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_;
diff --git a/services/ui/surfaces/BUILD.gn b/services/ui/surfaces/BUILD.gn index d0bdd99d..c4f8e46 100644 --- a/services/ui/surfaces/BUILD.gn +++ b/services/ui/surfaces/BUILD.gn
@@ -12,8 +12,6 @@ "display_compositor.h", "gpu_compositor_frame_sink.cc", "gpu_compositor_frame_sink.h", - "mus_gpu_memory_buffer_manager.cc", - "mus_gpu_memory_buffer_manager.h", ] deps = [ @@ -32,7 +30,7 @@ "//gpu/ipc/common", "//services/service_manager/public/cpp", "//services/tracing/public/cpp", - "//services/ui/common:mus_common", + "//services/ui/common:server_gpu", "//services/ui/gpu/interfaces", "//services/ui/public/interfaces", "//ui/display/types",
diff --git a/services/ui/surfaces/display_compositor.cc b/services/ui/surfaces/display_compositor.cc index 17643991..ed78b51 100644 --- a/services/ui/surfaces/display_compositor.cc +++ b/services/ui/surfaces/display_compositor.cc
@@ -9,6 +9,7 @@ #include "gpu/command_buffer/client/shared_memory_limits.h" #include "gpu/ipc/gpu_in_process_thread_service.h" #include "mojo/public/cpp/bindings/strong_binding.h" +#include "services/ui/common/mus_gpu_memory_buffer_manager.h" #include "services/ui/surfaces/gpu_compositor_frame_sink.h" namespace ui {
diff --git a/services/ui/surfaces/display_compositor.h b/services/ui/surfaces/display_compositor.h index d31ccfdf..243291c8 100644 --- a/services/ui/surfaces/display_compositor.h +++ b/services/ui/surfaces/display_compositor.h
@@ -18,7 +18,7 @@ #include "gpu/ipc/in_process_command_buffer.h" #include "ipc/ipc_channel_handle.h" #include "mojo/public/cpp/bindings/binding.h" -#include "services/ui/surfaces/mus_gpu_memory_buffer_manager.h" +#include "services/ui/common/mus_gpu_memory_buffer_manager.h" namespace gpu { class ImageFactory;
diff --git a/services/ui/ws/BUILD.gn b/services/ui/ws/BUILD.gn index 4b4bcd7a..deca343 100644 --- a/services/ui/ws/BUILD.gn +++ b/services/ui/ws/BUILD.gn
@@ -130,6 +130,7 @@ "//services/service_manager/public/interfaces", "//services/tracing/public/cpp", "//services/ui/common:mus_common", + "//services/ui/common:server_gpu", "//services/ui/display", "//services/ui/public/interfaces", "//ui/base",
diff --git a/services/ui/ws/gpu_service_proxy.cc b/services/ui/ws/gpu_service_proxy.cc index 8964295..bdac226d 100644 --- a/services/ui/ws/gpu_service_proxy.cc +++ b/services/ui/ws/gpu_service_proxy.cc
@@ -13,6 +13,7 @@ #include "mojo/public/cpp/system/buffer.h" #include "mojo/public/cpp/system/platform_handle.h" #include "services/service_manager/public/cpp/connection.h" +#include "services/ui/common/mus_gpu_memory_buffer_manager.h" #include "services/ui/ws/gpu_service_proxy_delegate.h" #include "ui/gfx/buffer_format_util.h" @@ -36,6 +37,8 @@ gpu_main_.Create(GetProxy(&gpu_service_)); gpu_service_->Initialize( base::Bind(&GpuServiceProxy::OnInitialized, base::Unretained(this))); + gpu_memory_buffer_manager_ = base::MakeUnique<MusGpuMemoryBufferManager>( + gpu_service_.get(), next_client_id_++); } GpuServiceProxy::~GpuServiceProxy() {
diff --git a/services/ui/ws/gpu_service_proxy.h b/services/ui/ws/gpu_service_proxy.h index 45918ce..c85b66f5 100644 --- a/services/ui/ws/gpu_service_proxy.h +++ b/services/ui/ws/gpu_service_proxy.h
@@ -63,6 +63,7 @@ mojom::GpuServiceInternalPtr gpu_service_; mojo::BindingSet<mojom::GpuService> bindings_; gpu::GPUInfo gpu_info_; + std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager_; GpuMain gpu_main_; DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy);
diff --git a/services/video_capture/BUILD.gn b/services/video_capture/BUILD.gn index 66cad4f..522df4e 100644 --- a/services/video_capture/BUILD.gn +++ b/services/video_capture/BUILD.gn
@@ -48,8 +48,8 @@ "//base", "//media", "//media/capture:capture", + "//media/capture/mojo:image_capture", "//media/mojo/common:common", - "//media/mojo/interfaces:image_capture", "//mojo/common:common_base", "//services/service_manager/public/cpp", "//services/video_capture/public/interfaces",
diff --git a/third_party/WebKit/LayoutTests/NeverFixTests b/third_party/WebKit/LayoutTests/NeverFixTests index ef25e0b..39cb1a1 100644 --- a/third_party/WebKit/LayoutTests/NeverFixTests +++ b/third_party/WebKit/LayoutTests/NeverFixTests
@@ -80,6 +80,9 @@ # AAT/mortx shaping not supported on platforms other than Mac [ Linux Win Android ] fast/text/aat-morx.html [ WontFix ] +# Linux layout tests do not have a Myanmar fallback font. +[ Linux ] inspector-protocol/layout-fonts/fallback-myanmar.html [ WontFix ] + # Tests in media/stable are only supposed to be run as virtual test (see virtual/stable/media). media/stable [ WontFix ]
diff --git a/third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html b/third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html new file mode 100644 index 0000000..7fda0d5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/accessibility/css-first-letter-children.html
@@ -0,0 +1,40 @@ +<!DOCTYPE html> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<style> +p::first-letter { + font-size: 200%; +} +</style> +<h1 id="heading">Test heading</h1> +<p id="text">Test text</p> +<script> +test(function () { + if (!window.accessibilityController) { + assert_unreached("This test requires accessibilityController."); + return; + } + + // Test an element that gets its own accessible name. + let element = accessibilityController.accessibleElementById("heading"); + assert_equals(element.name, "Test heading"); + + function getAccessibilityChildren(element) { + let children = []; + let childrenCount = element.childrenCount; + for (let i = 0; i < childrenCount; i++) { + let child = element.childAtIndex(i); + children.push(child); + child.children = getAccessibilityChildren(child); + } + return children; + } + + // Test by concatenating names of all children. + element = accessibilityController.accessibleElementById("text"); + let children = getAccessibilityChildren(element); + assert_equals(children.length, 1); + let name = children.map(e => e.name).join(''); + assert_equals(name, "Test text"); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt b/third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt index eb55ddf5..5873f9e 100644 --- a/third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt
@@ -8,8 +8,6 @@ AXRole: AXWebArea AXRole: AXDescriptionListTerm - AXRole: AXStaticText "D" - AXRole: AXInlineTextBox "D" AXRole: AXStaticText "Dt" AXRole: AXInlineTextBox "Dt" AXRole: AXParagraph
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/aes-cbc/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/aes-cbc/cloneKey-expected.txt index aa3fc0b..aa954b3 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/aes-cbc/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/aes-cbc/cloneKey-expected.txt
@@ -18,7 +18,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010110031030112233445566778899aabbccddeeff +Serialized key bytes: 4b010110031030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -36,7 +36,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010120032000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010120032000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -54,7 +54,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010110451030112233445566778899aabbccddeeff +Serialized key bytes: 4b010110451030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -72,7 +72,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010120452000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010120452000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -90,7 +90,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010110c3011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010110c3011030112233445566778899aabbccddeeff00 PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -108,7 +108,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010120c3012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010120c3012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -126,7 +126,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010110021030112233445566778899aabbccddeeff +Serialized key bytes: 4b010110021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -143,7 +143,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010120022000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010120022000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -160,7 +160,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010110441030112233445566778899aabbccddeeff +Serialized key bytes: 4b010110441030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -177,7 +177,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010120442000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010120442000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -194,7 +194,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010110c2011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010110c2011030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -211,7 +211,7 @@ PASS clonedKey.algorithm.name is "AES-CBC" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010120c2012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010120c2012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/aes-ctr/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/aes-ctr/cloneKey-expected.txt index 3dfb9e9f..8e90c6b 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/aes-ctr/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/aes-ctr/cloneKey-expected.txt
@@ -18,7 +18,7 @@ PASS clonedKey.algorithm.name is "AES-CTR" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010b10c1011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010b10c1011030112233445566778899aabbccddeeff00 PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -36,7 +36,7 @@ PASS clonedKey.algorithm.name is "AES-CTR" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010b20c1012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010b20c1012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -54,7 +54,7 @@ PASS clonedKey.algorithm.name is "AES-CTR" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010b10c0011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010b10c0011030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -71,7 +71,7 @@ PASS clonedKey.algorithm.name is "AES-CTR" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010b20c0012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010b20c0012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/aes-gcm/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/aes-gcm/cloneKey-expected.txt index 1af0b93..ca5251a 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/aes-gcm/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/aes-gcm/cloneKey-expected.txt
@@ -18,7 +18,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010910031030112233445566778899aabbccddeeff +Serialized key bytes: 4b010910031030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -36,7 +36,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010920032000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010920032000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -54,7 +54,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010910451030112233445566778899aabbccddeeff +Serialized key bytes: 4b010910451030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -72,7 +72,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010920452000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010920452000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -90,7 +90,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010910c3011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010910c3011030112233445566778899aabbccddeeff00 PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -108,7 +108,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010920c3012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010920c3012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -126,7 +126,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010910021030112233445566778899aabbccddeeff +Serialized key bytes: 4b010910021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -143,7 +143,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt" -Serialized key bytes: 3f004b010920022000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010920022000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -160,7 +160,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010910441030112233445566778899aabbccddeeff +Serialized key bytes: 4b010910441030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -177,7 +177,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "decrypt,wrapKey" -Serialized key bytes: 3f004b010920442000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f +Serialized key bytes: 4b010920442000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -194,7 +194,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010910c2011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010910c2011030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -211,7 +211,7 @@ PASS clonedKey.algorithm.name is "AES-GCM" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "encrypt,wrapKey,unwrapKey" -Serialized key bytes: 3f004b010920c2012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010920c2012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/aes-kw/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/aes-kw/cloneKey-expected.txt index 7a60017..e7414d31 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/aes-kw/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/aes-kw/cloneKey-expected.txt
@@ -18,7 +18,7 @@ PASS clonedKey.algorithm.name is "AES-KW" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010c10c1011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010c10c1011030112233445566778899aabbccddeeff00 PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -36,7 +36,7 @@ PASS clonedKey.algorithm.name is "AES-KW" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010c20c1012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010c20c1012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS: Cloned key exported data should be [00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f] and was PASS importedKey.extraProperty is "hi" @@ -54,7 +54,7 @@ PASS clonedKey.algorithm.name is "AES-KW" PASS clonedKey.algorithm.length is 128 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010c10c0011030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b010c10c0011030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -71,7 +71,7 @@ PASS clonedKey.algorithm.name is "AES-KW" PASS clonedKey.algorithm.length is 256 PASS clonedKey.usages.join(',') is "wrapKey,unwrapKey" -Serialized key bytes: 3f004b010c20c0012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 +Serialized key bytes: 4b010c20c0012000112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f00 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/ecdh/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/ecdh/cloneKey-expected.txt index 1e617998..22828f6 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/ecdh/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/ecdh/cloneKey-expected.txt
@@ -18,7 +18,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050f0101015b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 +Serialized key bytes: 4b050f0101015b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 PASS: Cloned key exported data should be [3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78] and was PASS importedKey.extraProperty is "hi" @@ -36,7 +36,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050f0101005b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 +Serialized key bytes: 4b050f0101005b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -53,7 +53,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050f010201783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 +Serialized key bytes: 4b050f010201783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 PASS: Cloned key exported data should be [3076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b9267] and was PASS importedKey.extraProperty is "hi" @@ -71,7 +71,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050f010200783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 +Serialized key bytes: 4b050f010200783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -88,7 +88,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050f0103019e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee +Serialized key bytes: 4b050f0103019e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee PASS: Cloned key exported data should be [30819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee] and was PASS importedKey.extraProperty is "hi" @@ -106,7 +106,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050f0103009e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee +Serialized key bytes: 4b050f0103009e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -123,7 +123,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b050f020181028a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c600 +Serialized key bytes: 4b050f020181028a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c600 PASS: Cloned key exported data should be [308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c6] and was PASS importedKey.extraProperty is "hi" @@ -141,7 +141,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b050f020180028a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c600 +Serialized key bytes: 4b050f020180028a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c600 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -158,7 +158,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b050f02028102b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e +Serialized key bytes: 4b050f02028102b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e PASS: Cloned key exported data should be [3081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e] and was PASS importedKey.extraProperty is "hi" @@ -176,7 +176,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b050f02028002b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e +Serialized key bytes: 4b050f02028002b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -193,7 +193,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b050f02038102f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d +Serialized key bytes: 4b050f02038102f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d PASS: Cloned key exported data should be [3081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d] and was PASS importedKey.extraProperty is "hi" @@ -211,7 +211,7 @@ PASS clonedKey.algorithm.name is "ECDH" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b050f02038002f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d +Serialized key bytes: 4b050f02038002f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/ecdsa/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/ecdsa/cloneKey-expected.txt index f949a31..3cc9b97 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/ecdsa/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/ecdsa/cloneKey-expected.txt
@@ -18,7 +18,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050e0101015b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 +Serialized key bytes: 4b050e0101015b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 PASS: Cloned key exported data should be [3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78] and was PASS importedKey.extraProperty is "hi" @@ -36,7 +36,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b050e0101115b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 +Serialized key bytes: 4b050e0101115b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 PASS: Cloned key exported data should be [3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78] and was PASS importedKey.extraProperty is "hi" @@ -54,7 +54,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050e0101005b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 +Serialized key bytes: 4b050e0101005b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -71,7 +71,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b050e0101105b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 +Serialized key bytes: 4b050e0101105b3059301306072a8648ce3d020106082a8648ce3d030107034200049cb0cf69303dafc761d4e4687b4ecf039e6d34ab964af80810d8d558a4a8d6f72d51233a1788920a86ee08a1962c79efa317fb7879e297dad2146db995fa1c78 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -88,7 +88,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050e010201783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 +Serialized key bytes: 4b050e010201783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 PASS: Cloned key exported data should be [3076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b9267] and was PASS importedKey.extraProperty is "hi" @@ -106,7 +106,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b050e010211783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 +Serialized key bytes: 4b050e010211783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 PASS: Cloned key exported data should be [3076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b9267] and was PASS importedKey.extraProperty is "hi" @@ -124,7 +124,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050e010200783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 +Serialized key bytes: 4b050e010200783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -141,7 +141,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b050e010210783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 +Serialized key bytes: 4b050e010210783076301006072a8648ce3d020106052b81040022036200040874a2e0b8ff448f0e54321e27f4f1e64d064cdeb7d26f458c32e930120f4e57dc85c2693f977eed4a8ecc8db981b4d91f69446df4f4c6f5de19003f45f891d0ebcd2fffdb5c81c040e8d6994c43c7feedb98a4a31edfb35e89a30013c3b926700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -158,7 +158,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050e0103019e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee +Serialized key bytes: 4b050e0103019e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee PASS: Cloned key exported data should be [30819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee] and was PASS importedKey.extraProperty is "hi" @@ -176,7 +176,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b050e0103119e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee +Serialized key bytes: 4b050e0103119e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee PASS: Cloned key exported data should be [30819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee] and was PASS importedKey.extraProperty is "hi" @@ -194,7 +194,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b050e0103009e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee +Serialized key bytes: 4b050e0103009e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -211,7 +211,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b050e0103109e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee +Serialized key bytes: 4b050e0103109e0130819b301006072a8648ce3d020106052b81040023038186000400f50a08703250c15f043c8c46e99783435245cf98f4f2694b0e2f8d029a514dd6f0b086d4ed892000cd5590107aae69c4c0a7a95f7cf74e5770a07d5db55bce4ab400f2c770bab8b9be4cdb6ecd3dc26c698da0d2599cebf3d904f7f9ca3a55e64731810d73cd317264e50baba4bc2860857e16d6cbb79501bc9e3a32bd172ea8a71dee PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -228,7 +228,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b050e0201098a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c6 +Serialized key bytes: 4b050e0201098a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c6 PASS: Cloned key exported data should be [308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c6] and was PASS importedKey.extraProperty is "hi" @@ -246,7 +246,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b050e0201088a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c6 +Serialized key bytes: 4b050e0201088a01308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b02010104201fe33950c5f461124ae992c2bdfdf1c73b1615f571bd567e60d19aa1f48cdf42a144034200047c110c66dcfda807f6e69e45ddb3c74f69a1484d203e8dc5ada8e9a9dd7cb3c70df448986e51bde5d1576f99901f9c2c6a806a47fd907643a72b835597efc8c6 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -263,7 +263,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b050e020209b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e00 +Serialized key bytes: 4b050e020209b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e00 PASS: Cloned key exported data should be [3081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e] and was PASS importedKey.extraProperty is "hi" @@ -281,7 +281,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-384" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b050e020208b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e00 +Serialized key bytes: 4b050e020208b9013081b6020100301006072a8648ce3d020106052b8104002204819e30819b0201010430a492ce8fa90084c227e1a32f7974d39e9ff67a7e8705ec3419b35fb607582bebd461e0b1520ac76ec2dd4e9b63ebae71a16403620004e55fee6c49d8d523f5ce7bf9c0425ce4ff650708b7de5cfb095901523979a7f042602db30854735369813b5c3f5ef86828f59cc5dc509892a988d38a8e2519de3d0c4fd0fbdb0993e38f18506c17606c5e24249246f1ce94983a5361c5be983e00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -298,7 +298,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b050e020309f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d00 +Serialized key bytes: 4b050e020309f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d00 PASS: Cloned key exported data should be [3081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d] and was PASS importedKey.extraProperty is "hi" @@ -316,7 +316,7 @@ PASS clonedKey.algorithm.name is "ECDSA" PASS clonedKey.algorithm.namedCurve is "P-521" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b050e020308f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d00 +Serialized key bytes: 4b050e020308f1013081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044201bd56bd106118eda246155bd43b42b8e13f0a6e25dd3bb376026fab4dc92b6157bc6dfec2d15dd3d0cf2a39aa68494042af48ba9601118da82c6f2108a3a203ad74a181890381860004012fbcaeffa6a51f3ee4d3d2b51c5dec6d7c726ca353fc014ea2bf7cfbb9b910d32cbfa6a00fe39b6cdb8946f22775398b2e233c0cf144d78c8a7742b5c7a3bb5d23009cdef823dd7bf9a79e8cceacd2e4527c231d0ae5967af0958e931d7ddccf2805a3e618dc3039fec9febbd33052fe4c0fee98f033106064982d88f4e03549d4a64d00 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/hkdf/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/hkdf/cloneKey-expected.txt index 3fc3e78..3f3c40c 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/hkdf/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/hkdf/cloneKey-expected.txt
@@ -16,7 +16,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b0610800200 +Serialized key bytes: 4b0610800200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -31,7 +31,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06108002013000 +Serialized key bytes: 4b06108002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -46,7 +46,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06108002080011223344554677 +Serialized key bytes: 4b06108002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -61,7 +61,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061080020b00112233445546778899aa00 +Serialized key bytes: 4b061080020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -76,7 +76,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061080021030112233445566778899aabbccddeeff +Serialized key bytes: 4b061080021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -91,7 +91,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200000 +Serialized key bytes: 4b0610200000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -106,7 +106,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200130 +Serialized key bytes: 4b0610200130 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -121,7 +121,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b06102008001122334455467700 +Serialized key bytes: 4b06102008001122334455467700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -136,7 +136,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200b00112233445546778899aa +Serialized key bytes: 4b0610200b00112233445546778899aa PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -151,7 +151,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610201030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b0610201030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -166,7 +166,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a00200 +Serialized key bytes: 4b0610a00200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -181,7 +181,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a002013000 +Serialized key bytes: 4b0610a002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -196,7 +196,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a002080011223344554677 +Serialized key bytes: 4b0610a002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -211,7 +211,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a0020b00112233445546778899aa00 +Serialized key bytes: 4b0610a0020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -226,7 +226,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a0021030112233445566778899aabbccddeeff +Serialized key bytes: 4b0610a0021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -241,7 +241,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b0610800200 +Serialized key bytes: 4b0610800200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -256,7 +256,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06108002013000 +Serialized key bytes: 4b06108002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -271,7 +271,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06108002080011223344554677 +Serialized key bytes: 4b06108002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -286,7 +286,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061080020b00112233445546778899aa00 +Serialized key bytes: 4b061080020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -301,7 +301,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061080021030112233445566778899aabbccddeeff +Serialized key bytes: 4b061080021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -316,7 +316,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200000 +Serialized key bytes: 4b0610200000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -331,7 +331,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200130 +Serialized key bytes: 4b0610200130 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -346,7 +346,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b06102008001122334455467700 +Serialized key bytes: 4b06102008001122334455467700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -361,7 +361,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200b00112233445546778899aa +Serialized key bytes: 4b0610200b00112233445546778899aa PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -376,7 +376,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610201030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b0610201030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -391,7 +391,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a00200 +Serialized key bytes: 4b0610a00200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -406,7 +406,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a002013000 +Serialized key bytes: 4b0610a002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -421,7 +421,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a002080011223344554677 +Serialized key bytes: 4b0610a002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -436,7 +436,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a0020b00112233445546778899aa00 +Serialized key bytes: 4b0610a0020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -451,7 +451,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a0021030112233445566778899aabbccddeeff +Serialized key bytes: 4b0610a0021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -466,7 +466,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b0610800200 +Serialized key bytes: 4b0610800200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -481,7 +481,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06108002013000 +Serialized key bytes: 4b06108002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -496,7 +496,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06108002080011223344554677 +Serialized key bytes: 4b06108002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -511,7 +511,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061080020b00112233445546778899aa00 +Serialized key bytes: 4b061080020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -526,7 +526,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061080021030112233445566778899aabbccddeeff +Serialized key bytes: 4b061080021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -541,7 +541,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200000 +Serialized key bytes: 4b0610200000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -556,7 +556,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200130 +Serialized key bytes: 4b0610200130 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -571,7 +571,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b06102008001122334455467700 +Serialized key bytes: 4b06102008001122334455467700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -586,7 +586,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610200b00112233445546778899aa +Serialized key bytes: 4b0610200b00112233445546778899aa PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -601,7 +601,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0610201030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b0610201030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -616,7 +616,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a00200 +Serialized key bytes: 4b0610a00200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -631,7 +631,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a002013000 +Serialized key bytes: 4b0610a002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -646,7 +646,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a002080011223344554677 +Serialized key bytes: 4b0610a002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -661,7 +661,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a0020b00112233445546778899aa00 +Serialized key bytes: 4b0610a0020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -676,7 +676,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "HKDF" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0610a0021030112233445566778899aabbccddeeff +Serialized key bytes: 4b0610a0021030112233445566778899aabbccddeeff PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/hmac/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/hmac/cloneKey-expected.txt index d75e463..5f57e09 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/hmac/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/hmac/cloneKey-expected.txt
@@ -20,7 +20,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02010509013000 +Serialized key bytes: 4b02010509013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -40,7 +40,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02080509080011223344554677 +Serialized key bytes: 4b02080509080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -60,7 +60,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b020b05090b00112233445546778899aa00 +Serialized key bytes: 4b020b05090b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -80,7 +80,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b021005091030112233445566778899aabbccddeeff +Serialized key bytes: 4b021005091030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -100,7 +100,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02010511013000 +Serialized key bytes: 4b02010511013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -120,7 +120,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02080511080011223344554677 +Serialized key bytes: 4b02080511080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -140,7 +140,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b020b05110b00112233445546778899aa00 +Serialized key bytes: 4b020b05110b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -160,7 +160,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b021005111030112233445566778899aabbccddeeff +Serialized key bytes: 4b021005111030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -180,7 +180,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02010519013000 +Serialized key bytes: 4b02010519013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -200,7 +200,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02080519080011223344554677 +Serialized key bytes: 4b02080519080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -220,7 +220,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b020b05190b00112233445546778899aa00 +Serialized key bytes: 4b020b05190b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -240,7 +240,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b021005191030112233445566778899aabbccddeeff +Serialized key bytes: 4b021005191030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -260,7 +260,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02010508013000 +Serialized key bytes: 4b02010508013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -279,7 +279,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02080508080011223344554677 +Serialized key bytes: 4b02080508080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -298,7 +298,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b020b05080b00112233445546778899aa00 +Serialized key bytes: 4b020b05080b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -317,7 +317,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b021005081030112233445566778899aabbccddeeff +Serialized key bytes: 4b021005081030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -336,7 +336,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02010510013000 +Serialized key bytes: 4b02010510013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -355,7 +355,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02080510080011223344554677 +Serialized key bytes: 4b02080510080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -374,7 +374,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b020b05100b00112233445546778899aa00 +Serialized key bytes: 4b020b05100b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -393,7 +393,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b021005101030112233445566778899aabbccddeeff +Serialized key bytes: 4b021005101030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -412,7 +412,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02010518013000 +Serialized key bytes: 4b02010518013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -431,7 +431,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02080518080011223344554677 +Serialized key bytes: 4b02080518080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -450,7 +450,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b020b05180b00112233445546778899aa00 +Serialized key bytes: 4b020b05180b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -469,7 +469,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b021005181030112233445566778899aabbccddeeff +Serialized key bytes: 4b021005181030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -488,7 +488,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02010609013000 +Serialized key bytes: 4b02010609013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -508,7 +508,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02080609080011223344554677 +Serialized key bytes: 4b02080609080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -528,7 +528,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b020b06090b00112233445546778899aa00 +Serialized key bytes: 4b020b06090b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -548,7 +548,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b021006091030112233445566778899aabbccddeeff +Serialized key bytes: 4b021006091030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -568,7 +568,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02010611013000 +Serialized key bytes: 4b02010611013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -588,7 +588,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02080611080011223344554677 +Serialized key bytes: 4b02080611080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -608,7 +608,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b020b06110b00112233445546778899aa00 +Serialized key bytes: 4b020b06110b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -628,7 +628,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b021006111030112233445566778899aabbccddeeff +Serialized key bytes: 4b021006111030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -648,7 +648,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02010619013000 +Serialized key bytes: 4b02010619013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -668,7 +668,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02080619080011223344554677 +Serialized key bytes: 4b02080619080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -688,7 +688,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b020b06190b00112233445546778899aa00 +Serialized key bytes: 4b020b06190b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -708,7 +708,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b021006191030112233445566778899aabbccddeeff +Serialized key bytes: 4b021006191030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -728,7 +728,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02010608013000 +Serialized key bytes: 4b02010608013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -747,7 +747,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02080608080011223344554677 +Serialized key bytes: 4b02080608080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -766,7 +766,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b020b06080b00112233445546778899aa00 +Serialized key bytes: 4b020b06080b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -785,7 +785,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b021006081030112233445566778899aabbccddeeff +Serialized key bytes: 4b021006081030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -804,7 +804,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02010610013000 +Serialized key bytes: 4b02010610013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -823,7 +823,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02080610080011223344554677 +Serialized key bytes: 4b02080610080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -842,7 +842,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b020b06100b00112233445546778899aa00 +Serialized key bytes: 4b020b06100b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -861,7 +861,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b021006101030112233445566778899aabbccddeeff +Serialized key bytes: 4b021006101030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -880,7 +880,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02010618013000 +Serialized key bytes: 4b02010618013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -899,7 +899,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02080618080011223344554677 +Serialized key bytes: 4b02080618080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -918,7 +918,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b020b06180b00112233445546778899aa00 +Serialized key bytes: 4b020b06180b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -937,7 +937,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b021006181030112233445566778899aabbccddeeff +Serialized key bytes: 4b021006181030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -956,7 +956,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02010809013000 +Serialized key bytes: 4b02010809013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -976,7 +976,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02080809080011223344554677 +Serialized key bytes: 4b02080809080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -996,7 +996,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b020b08090b00112233445546778899aa00 +Serialized key bytes: 4b020b08090b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -1016,7 +1016,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b021008091030112233445566778899aabbccddeeff +Serialized key bytes: 4b021008091030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -1036,7 +1036,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02010811013000 +Serialized key bytes: 4b02010811013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -1056,7 +1056,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02080811080011223344554677 +Serialized key bytes: 4b02080811080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -1076,7 +1076,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b020b08110b00112233445546778899aa00 +Serialized key bytes: 4b020b08110b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -1096,7 +1096,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b021008111030112233445566778899aabbccddeeff +Serialized key bytes: 4b021008111030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -1116,7 +1116,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02010819013000 +Serialized key bytes: 4b02010819013000 PASS: Cloned key exported data should be [30] and was PASS importedKey.extraProperty is "hi" @@ -1136,7 +1136,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02080819080011223344554677 +Serialized key bytes: 4b02080819080011223344554677 PASS: Cloned key exported data should be [0011223344554677] and was PASS importedKey.extraProperty is "hi" @@ -1156,7 +1156,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b020b08190b00112233445546778899aa00 +Serialized key bytes: 4b020b08190b00112233445546778899aa00 PASS: Cloned key exported data should be [00112233445546778899aa] and was PASS importedKey.extraProperty is "hi" @@ -1176,7 +1176,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b021008191030112233445566778899aabbccddeeff +Serialized key bytes: 4b021008191030112233445566778899aabbccddeeff PASS: Cloned key exported data should be [30112233445566778899aabbccddeeff] and was PASS importedKey.extraProperty is "hi" @@ -1196,7 +1196,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02010808013000 +Serialized key bytes: 4b02010808013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1215,7 +1215,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b02080808080011223344554677 +Serialized key bytes: 4b02080808080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1234,7 +1234,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b020b08080b00112233445546778899aa00 +Serialized key bytes: 4b020b08080b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1253,7 +1253,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b021008081030112233445566778899aabbccddeeff +Serialized key bytes: 4b021008081030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1272,7 +1272,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02010810013000 +Serialized key bytes: 4b02010810013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1291,7 +1291,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b02080810080011223344554677 +Serialized key bytes: 4b02080810080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1310,7 +1310,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b020b08100b00112233445546778899aa00 +Serialized key bytes: 4b020b08100b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1329,7 +1329,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b021008101030112233445566778899aabbccddeeff +Serialized key bytes: 4b021008101030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1348,7 +1348,7 @@ PASS clonedKey.algorithm.length is 8 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02010818013000 +Serialized key bytes: 4b02010818013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1367,7 +1367,7 @@ PASS clonedKey.algorithm.length is 64 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b02080818080011223344554677 +Serialized key bytes: 4b02080818080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1386,7 +1386,7 @@ PASS clonedKey.algorithm.length is 88 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b020b08180b00112233445546778899aa00 +Serialized key bytes: 4b020b08180b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -1405,7 +1405,7 @@ PASS clonedKey.algorithm.length is 128 PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign,verify" -Serialized key bytes: 3f004b021008181030112233445566778899aabbccddeeff +Serialized key bytes: 4b021008181030112233445566778899aabbccddeeff PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/cloneKey-expected.txt index 5c8460b..986e63f 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/cloneKey-expected.txt
@@ -16,7 +16,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b0611800200 +Serialized key bytes: 4b0611800200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -31,7 +31,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06118002013000 +Serialized key bytes: 4b06118002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -46,7 +46,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06118002080011223344554677 +Serialized key bytes: 4b06118002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -61,7 +61,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061180020b00112233445546778899aa00 +Serialized key bytes: 4b061180020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -76,7 +76,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061180021030112233445566778899aabbccddeeff +Serialized key bytes: 4b061180021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -91,7 +91,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200000 +Serialized key bytes: 4b0611200000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -106,7 +106,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200130 +Serialized key bytes: 4b0611200130 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -121,7 +121,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b06112008001122334455467700 +Serialized key bytes: 4b06112008001122334455467700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -136,7 +136,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200b00112233445546778899aa +Serialized key bytes: 4b0611200b00112233445546778899aa PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -151,7 +151,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611201030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b0611201030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -166,7 +166,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a00200 +Serialized key bytes: 4b0611a00200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -181,7 +181,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a002013000 +Serialized key bytes: 4b0611a002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -196,7 +196,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a002080011223344554677 +Serialized key bytes: 4b0611a002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -211,7 +211,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a0020b00112233445546778899aa00 +Serialized key bytes: 4b0611a0020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -226,7 +226,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a0021030112233445566778899aabbccddeeff +Serialized key bytes: 4b0611a0021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -241,7 +241,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b0611800200 +Serialized key bytes: 4b0611800200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -256,7 +256,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06118002013000 +Serialized key bytes: 4b06118002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -271,7 +271,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06118002080011223344554677 +Serialized key bytes: 4b06118002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -286,7 +286,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061180020b00112233445546778899aa00 +Serialized key bytes: 4b061180020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -301,7 +301,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061180021030112233445566778899aabbccddeeff +Serialized key bytes: 4b061180021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -316,7 +316,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200000 +Serialized key bytes: 4b0611200000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -331,7 +331,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200130 +Serialized key bytes: 4b0611200130 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -346,7 +346,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b06112008001122334455467700 +Serialized key bytes: 4b06112008001122334455467700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -361,7 +361,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200b00112233445546778899aa +Serialized key bytes: 4b0611200b00112233445546778899aa PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -376,7 +376,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611201030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b0611201030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -391,7 +391,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a00200 +Serialized key bytes: 4b0611a00200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -406,7 +406,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a002013000 +Serialized key bytes: 4b0611a002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -421,7 +421,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a002080011223344554677 +Serialized key bytes: 4b0611a002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -436,7 +436,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a0020b00112233445546778899aa00 +Serialized key bytes: 4b0611a0020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -451,7 +451,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a0021030112233445566778899aabbccddeeff +Serialized key bytes: 4b0611a0021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -466,7 +466,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b0611800200 +Serialized key bytes: 4b0611800200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -481,7 +481,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06118002013000 +Serialized key bytes: 4b06118002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -496,7 +496,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b06118002080011223344554677 +Serialized key bytes: 4b06118002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -511,7 +511,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061180020b00112233445546778899aa00 +Serialized key bytes: 4b061180020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -526,7 +526,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveBits" -Serialized key bytes: 3f004b061180021030112233445566778899aabbccddeeff +Serialized key bytes: 4b061180021030112233445566778899aabbccddeeff PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -541,7 +541,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200000 +Serialized key bytes: 4b0611200000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -556,7 +556,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200130 +Serialized key bytes: 4b0611200130 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -571,7 +571,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b06112008001122334455467700 +Serialized key bytes: 4b06112008001122334455467700 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -586,7 +586,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611200b00112233445546778899aa +Serialized key bytes: 4b0611200b00112233445546778899aa PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -601,7 +601,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey" -Serialized key bytes: 3f004b0611201030112233445566778899aabbccddeeff00 +Serialized key bytes: 4b0611201030112233445566778899aabbccddeeff00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -616,7 +616,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a00200 +Serialized key bytes: 4b0611a00200 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -631,7 +631,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a002013000 +Serialized key bytes: 4b0611a002013000 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -646,7 +646,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a002080011223344554677 +Serialized key bytes: 4b0611a002080011223344554677 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -661,7 +661,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a0020b00112233445546778899aa00 +Serialized key bytes: 4b0611a0020b00112233445546778899aa00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "secret" @@ -676,7 +676,7 @@ PASS clonedKey.extractable is false PASS clonedKey.algorithm.name is "PBKDF2" PASS clonedKey.usages.join(',') is "deriveKey,deriveBits" -Serialized key bytes: 3f004b0611a0021030112233445566778899aabbccddeeff +Serialized key bytes: 4b0611a0021030112233445566778899aabbccddeeff PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5/cloneKey-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5/cloneKey-expected.txt index f9d7cab2..f91eb56a 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5/cloneKey-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5/cloneKey-expected.txt
@@ -22,7 +22,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018008030100010501a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010501a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS: Cloned key exported data should be [30819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001] and was PASS importedKey.extraProperty is "hi" @@ -44,7 +44,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018010030100010501a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010501a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS: Cloned key exported data should be [30820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001] and was PASS importedKey.extraProperty is "hi" @@ -66,7 +66,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018008030100010511a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010511a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS: Cloned key exported data should be [30819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001] and was PASS importedKey.extraProperty is "hi" @@ -88,7 +88,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018010030100010511a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010511a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS: Cloned key exported data should be [30820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001] and was PASS importedKey.extraProperty is "hi" @@ -110,7 +110,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018008030100010500a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010500a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -131,7 +131,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018010030100010500a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010500a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -152,7 +152,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018008030100010510a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010510a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -173,7 +173,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018010030100010510a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010510a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -194,7 +194,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018008030100010601a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010601a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS: Cloned key exported data should be [30819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001] and was PASS importedKey.extraProperty is "hi" @@ -216,7 +216,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018010030100010601a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010601a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS: Cloned key exported data should be [30820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001] and was PASS importedKey.extraProperty is "hi" @@ -238,7 +238,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018008030100010611a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010611a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS: Cloned key exported data should be [30819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001] and was PASS importedKey.extraProperty is "hi" @@ -260,7 +260,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018010030100010611a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010611a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS: Cloned key exported data should be [30820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001] and was PASS importedKey.extraProperty is "hi" @@ -282,7 +282,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018008030100010600a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010600a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -303,7 +303,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018010030100010600a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010600a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -324,7 +324,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018008030100010610a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010610a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -345,7 +345,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018010030100010610a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010610a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -366,7 +366,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018008030100010801a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010801a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS: Cloned key exported data should be [30819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001] and was PASS importedKey.extraProperty is "hi" @@ -388,7 +388,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018010030100010801a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010801a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS: Cloned key exported data should be [30820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001] and was PASS importedKey.extraProperty is "hi" @@ -410,7 +410,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018008030100010811a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010811a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS: Cloned key exported data should be [30819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001] and was PASS importedKey.extraProperty is "hi" @@ -432,7 +432,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018010030100010811a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010811a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS: Cloned key exported data should be [30820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001] and was PASS importedKey.extraProperty is "hi" @@ -454,7 +454,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018008030100010800a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010800a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -475,7 +475,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "" -Serialized key bytes: 3f004b0403018010030100010800a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010800a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -496,7 +496,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018008030100010810a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 +Serialized key bytes: 4b0403018008030100010810a20130819f300d06092a864886f70d010101050003818d0030818902818100b289c62ecc3ddf64154817203439eaa0dc07a65954429a7b6098a77235673d96df1f06bd3c1ae73990867199e678bf95b3728fcd4686136e6ee9dd4c09eb490eb7cb953c388668b759263f61d6a7dfcabf27b5c9d6972455b12b66d483843286d6b871f35f912a773c97c1932255fcee05ce7b8af213879f017de4232a306a410203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "public" @@ -517,7 +517,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "verify" -Serialized key bytes: 3f004b0403018010030100010810a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 +Serialized key bytes: 4b0403018010030100010810a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100b4c8b631194aef0154b1479ab7a534b60ca878981108680f0ae6b7c88cb6010f6dbf9f665646208410575cb923b26bf874a24b4cd801c9bba967062ae506cdcf307add4380d0d93077a4c1f0fc06d498dc729f811335c530b90fe9bf9f3979ccec050a48e8923045b19368e1e89ea4157538e8059e53320f47c155f1741310a93ed153a7f3af2d46c388b95d82518527a02b7bd9ab7edc4bcb737677f679c5c6de5e1ebed3a29d6b99b8eace2d59ceb533e001cf39c5671495d51d3ee34406ea4fdb0c626dee68da256b8a12f9f65059ccc85a2190ce1385152d62785e00cae702e77c4c597b86a6268adbf043dda68881c790f1517671fb7d198fca5ba97bef0203010001 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -538,7 +538,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028008030100010509f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 +Serialized key bytes: 4b0403028008030100010509f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 PASS: Cloned key exported data should be [30820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d] and was PASS importedKey.extraProperty is "hi" @@ -560,7 +560,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028010030100010509c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 +Serialized key bytes: 4b0403028010030100010509c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 PASS: Cloned key exported data should be [308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed] and was PASS importedKey.extraProperty is "hi" @@ -582,7 +582,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028008030100010508f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 +Serialized key bytes: 4b0403028008030100010508f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -603,7 +603,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-1" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028010030100010508c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 +Serialized key bytes: 4b0403028010030100010508c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -624,7 +624,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028008030100010609f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 +Serialized key bytes: 4b0403028008030100010609f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 PASS: Cloned key exported data should be [30820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d] and was PASS importedKey.extraProperty is "hi" @@ -646,7 +646,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028010030100010609c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 +Serialized key bytes: 4b0403028010030100010609c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 PASS: Cloned key exported data should be [308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed] and was PASS importedKey.extraProperty is "hi" @@ -668,7 +668,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028008030100010608f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 +Serialized key bytes: 4b0403028008030100010608f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -689,7 +689,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-256" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028010030100010608c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 +Serialized key bytes: 4b0403028010030100010608c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -710,7 +710,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028008030100010809f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 +Serialized key bytes: 4b0403028008030100010809f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 PASS: Cloned key exported data should be [30820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d] and was PASS importedKey.extraProperty is "hi" @@ -732,7 +732,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028010030100010809c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 +Serialized key bytes: 4b0403028010030100010809c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 PASS: Cloned key exported data should be [308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed] and was PASS importedKey.extraProperty is "hi" @@ -754,7 +754,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028008030100010808f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 +Serialized key bytes: 4b0403028008030100010808f90430820275020100300d06092a864886f70d01010105000482025f3082025b02010002818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137020301000102818033a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e894a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9ae55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325024100e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443024100b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd024028fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa02786197902401a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed74301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729024027156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe9319584b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d00 PASS importedKey.extraProperty is "hi" PASS importedKey.type is "private" @@ -775,7 +775,7 @@ PASS: clonedKey.algorithm.publicExponent should be [010001] and was PASS clonedKey.algorithm.hash.name is "SHA-512" PASS clonedKey.usages.join(',') is "sign" -Serialized key bytes: 3f004b0403028010030100010808c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 +Serialized key bytes: 4b0403028010030100010808c109308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100e085e33c42d3f3d63434e0bf1b812c444e790ff6c0becf2cc9de895afa601457bd0fafa81e2b977ab818d086d018491d7ff45be40e916c4c81b3d055ac1803b514e1010b983ff072b77fa228dd47024e65a3c72ab4e2ed02901ba43351dcd87beef92036983c42495d9efec5b4ea1113848b53287099cff1ba58a7829af733f19269101da8c10aa1d5d6b34d381dbb0704e58904c3504a1922f6956e95596780a5db08fe944ff3056ec070eafa66f8c1c5d7dcde4ce2c2694f240aec528eb699089e29f669fb3405c47d6309a609936e8b64e003b5f40743be6b7c2d5673e305cc4e2d154b2a046fba889b60913271b00d5321fd15f82cc41b2894ffc2e54d0b0203010001028201007ae930b59b8bf66f6c130a79f42fa9b117187521caf069f005eeda58c0b9fa48f1c9f58a5e41d4e22c880117dc317f4d33efeca2134b8ef2ef0a25e1d09d30e25fb4b162cc8d2c2f50bf0161c78908fd2bed15aa0e6e2ffb78327998529748b7c7e1ffbd8367718e423f390fb8736eb7b596a4067e65e58d5a4b1020927f03a293d5d3b32931d2a06542e9bbeab7e90085afc9fe145d1c28f44a97f8d9eb8c41913ed9f40261ac5f86806254e26aa8502b92779794a7b08ea299865cbdfeab4dd16307169902b46dbe132b035f7e2742f779f5b39a0b40099434a8af14c78f705abaa7474633a7c6306b2673a97aae35b6a3bf6a5fdd9a6b8d17bd6bbfa1872902818100f2bdbf99a43a4064ac5c85ccff42cccf14fa35250a8d77db6746478d0aea456377dc304688a55b1d2b14c46189ff4f92b078902ff66d144116038667cbbf5bfe80a775aa6eb9885686193debf030eaba00a8cbf26a4fdce1cb433a3a0ccd9696d64448141b0c5d9dfb32bdc29a271594d8e2bc0639daeec705b2cc12419876b702818100ecc964d844657b98dc6b3c6df58a4b5adff0cf5ac1a68679de2baccb4cda1b767f879e441769e5cc0065d8e573f9d728bbd4e25553ee8a2ba779eb219ad0a108daea34e7054d1767e644bdb63880234ac8143a9dda28d3f9196508088e2722ab86a3aa10e599b3caf226e69bee90a1ae7f289b945a34a4fed5e34f9d216b284d028180150ba27afda4174523347a5d459c5309793620396feac8037bb6ba295e52e565345520d25cb2896dc3f86ef64df296c18f0f44e103aa7d610f398b03a0c49c833a404a91563c3bb7d4b4878bd72d468c8dd614a895d30ac180cff952631dc7fa97e51fa2ae9da9d83299399e8fa2e7da19dbbe95839a99ad23af56c6166dd38d02818005da6497c3f90e391519c180a65528cfb2416d9ebcb2b5184619a647d03a83fb45e3c051c692638fcb62b91dd2e4162177a327851c720510572f7854785337e7d4217df547f843dfd99d516333ba5724fe1521edccfabd62a6f20c64c9bec5e89f876428cec421e19e62bfc892f918460bf6a101e5c8ef5b2d46552d792a00f102818100b7d0e59415405a3ce9503e95078078518d381f4273106d67863cfee642d2b82186d9932b7cd921bf1867257473ccd2058d9c88a223701701aa8370b90878df96a6950e3b3ed52326a5cabbf376c97aa644c50fafe38f7496fb9e69efdd138b3525d8b7ac162bd75fe84cb4ce7066d6b786e80c42d5e63059ae939c7bcfa497ed00 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions-expected.txt index 80ad948..c15715c 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions-expected.txt
@@ -5,9 +5,9 @@ PASS ctx = offscreenCanvas1.getContext('2d') did not throw exception. PASS ctx is an instance of OffscreenCanvasRenderingContext2D -PASS worker.postMessage({data: offscreenCanvas1}, [offscreenCanvas1]) threw exception DataCloneError: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas with a context could not be cloned.. +PASS worker.postMessage({data: offscreenCanvas1}, [offscreenCanvas1]) threw exception DataCloneError: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas could not be cloned because it had a rendering context.. PASS offscreenCanvas2.transferToImageBitmap() threw exception InvalidStateError: Failed to execute 'transferToImageBitmap' on 'OffscreenCanvas': Cannot transfer an ImageBitmap from a detached OffscreenCanvas. -PASS worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2]) threw exception DataCloneError: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas is detached and could not be cloned.. +PASS worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2]) threw exception DataCloneError: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas could not be cloned because it was detached.. PASS offscreenCanvas2.getContext('2d') threw exception InvalidStateError: Failed to execute 'getContext' on 'OffscreenCanvas': OffscreenCanvas object is detached. PASS ctx.drawImage(offscreenCanvas2, 0, 0) threw exception InvalidStateError: Failed to execute 'drawImage' on 'OffscreenCanvasRenderingContext2D': The image source is detached. PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt index 1fa0a13c..0a4d1b4 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt
@@ -1,5 +1,5 @@ Tests that we clone object hierarchies -PASS: 'postMessage((function(){}))' threw DataCloneError: Failed to execute 'postMessage' on 'Window': An object could not be cloned. +PASS: 'postMessage((function(){}))' threw DataCloneError: Failed to execute 'postMessage' on 'Window': function (){} could not be cloned. PASS: eventData is null of type object PASS: eventData is null of type object PASS: eventData is null of type object
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js index 8fb6096e..a2bbb65 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js
@@ -2,5 +2,5 @@ reallyDeepArray=[]; for (var i = 0; i < 100000; i++) reallyDeepArray=[reallyDeepArray]; -tryPostMessage('reallyDeepArray', true, null, DOMException.DATA_CLONE_ERR); +tryPostMessage('reallyDeepArray', true, null, RangeError); tryPostMessage('"done"');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-test.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-test.js index cfbbcc1..83f34790 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-test.js +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-test.js
@@ -175,7 +175,7 @@ } } catch(e) { if (shouldThrow) { - if (expectedException === undefined || expectedException == e.code || expectedException == e) { + if (expectedException === undefined || expectedException == e.code || expectedException == e || e instanceof expectedException) { console.innerHTML += "PASS: 'postMessage("+message+")' threw " + escapeHTML(e) + "<br>"; } else { console.innerHTML += "FAIL: 'postMessage("+message+")' threw " + escapeHTML(e) + ", was expecting " + escapeHTML(expectedException) + "<br>";
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt index 2da471f0..f7af080c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt
@@ -16,7 +16,7 @@ PASS Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception PASS Posting message ('[object MessagePort],[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception PASS Posting message ('data', [object MessagePort],[object MessagePort]): threw exception DataCloneError: Failed to execute 'postMessage' on 'Window': Port at index 0 is already neutered. -PASS Posting message ('[object MessagePort],[object MessagePort]', ): threw exception DataCloneError: Failed to execute 'postMessage' on 'Window': A MessagePort could not be cloned. +PASS Posting message ('[object MessagePort],[object MessagePort]', ): threw exception DataCloneError: Failed to execute 'postMessage' on 'Window': A MessagePort could not be cloned because it was not transferred. PASS Posting message ('[object ArrayBuffer]', [object ArrayBuffer]) did not throw an exception PASS arrayBuffer neutered PASS view neutered
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt index cd570cf8..74448e3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt
@@ -1,11 +1,11 @@ Tests that we clone object hierarchies -PASS: 'postMessage((function(){}))' threw DataCloneError: Failed to execute 'postMessage' on 'Window': An object could not be cloned. -PASS: 'postMessage(var x = 0; try { eval("badref"); } catch(e) { x = e; } x)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': An object could not be cloned. +PASS: 'postMessage((function(){}))' threw DataCloneError: Failed to execute 'postMessage' on 'Window': function (){} could not be cloned. +PASS: 'postMessage(var x = 0; try { eval("badref"); } catch(e) { x = e; } x)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': ReferenceError: badref is not defined could not be cloned. PASS: 'postMessage(arrayBuffer)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': An ArrayBuffer is neutered and could not be cloned. PASS: 'postMessage("data")' threw DataCloneError: Failed to execute 'postMessage' on 'Window': ArrayBuffer at index 1 is a duplicate of an earlier ArrayBuffer. PASS: 'postMessage(uint8Array)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': An ArrayBuffer is neutered and could not be cloned. -PASS: 'postMessage(window)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': An object could not be cloned. +PASS: 'postMessage(window)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': #<Window> could not be cloned. PASS: 'postMessage(({get a() { throw "x" }}))' threw x PASS: 'postMessage(blob.close(); blob)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': A Blob object has been closed, and could therefore not be cloned. PASS: 'postMessage(constructedFile.close(); constructedFile)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': A File object has been closed, and could therefore not be cloned.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array-expected.txt index 8083abe..11e9ba04 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array-expected.txt
@@ -1,5 +1,5 @@ Tests that we abort cloning overdeep arrays. -PASS: 'postMessage(reallyDeepArray)' threw DataCloneError: Failed to execute 'postMessage' on 'Window': Value being cloned is either cyclic or too deeply nested. +PASS: 'postMessage(reallyDeepArray)' threw RangeError: Maximum call stack size exceeded PASS: eventData is done of type string
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt index 981a7d9..22883fa 100644 --- a/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt
@@ -19,10 +19,10 @@ PASS event.ports is non-null and zero length when empty array sent PASS event.ports contains two ports when two ports sent PASS event.ports contains two ports when two ports re-sent after error -PASS Sending host object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned. -PASS Sending host object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned. -PASS Sending Function object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned. -PASS Sending Error object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned. +PASS Sending host object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': MessageChannel object could not be cloned. +PASS Sending host object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': Navigator object could not be cloned. +PASS Sending Function object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': function () {} could not be cloned. +PASS Sending Error object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': Error could not be cloned. PASS send-port: transferred one port PASS send-port-twice: transferred one port twice PASS send-two-ports: transferred two ports
diff --git a/third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html b/third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html new file mode 100644 index 0000000..1c851f10 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<style> + #scroller { + height: 100px; + width: 100px; + overflow: scroll; + background-color: red; + } + + #content { + width: 100px; + height: 100px; + background: green; + } +</style> + +<div id="scroller"> + <div id="content"></div> +</div> + +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> + +<script> +test(t => { + var scroller = document.querySelector("#scroller"); + var content = document.querySelector("#content"); + + content.style.transform = "translateX(400px)"; + assert_equals(scroller.scrollWidth, 500); + + scroller.scrollLeft = 300; + assert_equals(scroller.scrollLeft, 300); + + // make a non-layout inducing change that updates the overflow + content.style.transform = "translateX(100px)"; + assert_equals(scroller.scrollWidth, 200); + assert_equals(scroller.scrollLeft, 200 - scroller.clientWidth /* max scroll offset */); +}, "Verify that scroll offset clamps correctly when overflow rect is changed " + + " as a result of a transform (i.e., a non-layout inducing change)"); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value-expected.txt b/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value-expected.txt index 2071b8c..627826d 100644 --- a/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value-expected.txt
@@ -152,22 +152,6 @@ Serialize -10: PASS bufferView.length is expectedBufferValues.length -Deserialize to 1073741824: -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -Serialize 1073741824: -PASS bufferView.length is expectedBufferValues.length - -Backwards compatibility with version 3 serialization. - -Deserialize to 1073741824: -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -Serialize 1073741824: -PASS bufferView.length is expectedBufferValues.length - Deserialize to 36028797018963970: PASS JSON.stringify(newObj) is JSON.stringify(obj) PASS areValuesIdentical(newObj, obj) is true @@ -200,38 +184,6 @@ Serialize 1.23: PASS bufferView.length is expectedBufferValues.length -Deserialize to 2147483647: -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -Serialize 2147483647: -PASS bufferView.length is expectedBufferValues.length - -Backwards compatibility with version 3 serialization. - -Deserialize to 2147483647: -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -Serialize 2147483647: -PASS bufferView.length is expectedBufferValues.length - -Deserialize to -2147483648: -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -Serialize -2147483648: -PASS bufferView.length is expectedBufferValues.length - -Backwards compatibility with version 3 serialization. - -Deserialize to -2147483648: -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -PASS JSON.stringify(newObj) is JSON.stringify(obj) -PASS areValuesIdentical(newObj, obj) is true -Serialize -2147483648: -PASS bufferView.length is expectedBufferValues.length - Deserialize to 2147483648: PASS JSON.stringify(newObj) is JSON.stringify(obj) PASS areValuesIdentical(newObj, obj) is true
diff --git a/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html b/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html index 7875aa9..1fd8970 100644 --- a/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html +++ b/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html
@@ -27,91 +27,79 @@ // are only persisted out in the world in IndexedDB stores that were // written with implementations built before mid-2011. testSerialization({foo: 'zoo', bar: {baz: 'myNewKey'}}, - [ 0x003f, 0x3f6f, 0x5301, 0x6603, 0x6f6f, - 0x013f, 0x0353, 0x6f7a, 0x3f6f, 0x5301, - 0x6203, 0x7261, 0x013f, 0x3f6f, 0x5302, - 0x6203, 0x7a61, 0x023f, 0x0853, 0x796d, - 0x654e, 0x4b77, 0x7965, 0x017b, 0x027b ]); + [0x536f, 0x6603, 0x6f6f, 0x0353, 0x6f7a, 0x536f, 0x6203, + 0x7261, 0x536f, 0x6203, 0x7a61, 0x0853, 0x796d, 0x654e, + 0x4b77, 0x7965, 0x017b, 0x027b]); testSerialization({foo: 'zoo', bar: 'myNewKey'}, - [0x003f, 0x3f6f, 0x5301, 0x6603, 0x6f6f, - 0x013f, 0x0353, 0x6f7a, 0x3f6f, 0x5301, - 0x6203, 0x7261, 0x013f, 0x0853, 0x796d, - 0x654e, 0x4b77, 0x7965, 0x027b]); + [0x536f, 0x6603, 0x6f6f, 0x0353, 0x6f7a, 0x536f, 0x6203, + 0x7261, 0x0853, 0x796d, 0x654e, 0x4b77, 0x7965, 0x027b]); -testSerialization([], [0x003f, 0x0041, 0x0024, 0x0000 ]); +testSerialization([], [0x0041, 0x0024, 0x0000 ]); testSerialization({foo: "zoo"}, - [0x003f, 0x3f6f, 0x5301, 0x6603, 0x6f6f, - 0x013f, 0x0353, 0x6f7a, 0x7b6f, 0x0001], + [0x536f, 0x6603, 0x6f6f, 0x0353, 0x6f7a, 0x7b6f, 0x0001], [0x0353, 0x6f66, 0x536f, 0x7a03, 0x6f6f, 0x017b]); testSerialization({foo: null}, - [0x003f, 0x3f6f, 0x5301, 0x6603, 0x6f6f, - 0x013f, 0x7b30, 0x0001], + [0x536f, 0x6603, 0x6f6f, 0x7b30, 0x0001], [0x0353, 0x6f66, 0x306f, 0x017b]); -testSerialization({}, [0x003f, 0x7b6f, 0x0000], [0x007b]); +testSerialization({}, [0x7b6f, 0x0000], [0x007b]); -testSerialization(undefined, [0x003f, 0x005f]); -testSerialization(true, [0x003f, 0x0054]); -testSerialization(false, [0x003f, 0x0046]); +testSerialization(undefined, [0x005f]); +testSerialization(true, [0x0054]); +testSerialization(false, [0x0046]); // Sparse array deserialization is broken. // See: https://bugs.webkit.org/show_bug.cgi?id=96838 // testSerialization(new Array(100), [0x003f, 0x6461, 0x0040, 0x0064]); -testSerialization(10, [0x003f, 0x1449]); -testSerialization(-10, [0x003f, 0x1349]); -testSerialization(Math.pow(2,30), [0x003f, 0x8049, 0x8080, 0x0880]); -testSerialization(Math.pow(2,55), [0x003f, 0x004e, 0x0000, 0x0000, +testSerialization(10, [0x1449]); +testSerialization(-10, [0x1349]); +// This value is encoded differently by V8 depending on the CPU architecture, +// but the result can be read on any architecture. This code is tested in V8. +//testSerialization(Math.pow(2,30), [0x8049, 0x8080, 0x0880]); +testSerialization(Math.pow(2,55), [0x004e, 0x0000, 0x0000, 0x6000, 0x0043]); -testSerialization(1.23, [0x003f, 0xae4e, 0xe147, 0x147a, 0xf3ae, 0x003f]); +testSerialization(1.23, [0xae4e, 0xe147, 0x147a, 0xf3ae, 0x003f]); // Exercise special cases for Int32/Uint32. -testSerialization( 0x7fffffff, [0x003f, 0xfe49, 0xffff, 0x0fff]); -testSerialization(-0x80000000, [0x003f, 0xff49, 0xffff, 0x0fff]); -testSerialization( 0x80000000, [0x003f, 0x8055, 0x8080, 0x0880]); -testSerialization( 0xffffffff, [0x003f, 0xff55, 0xffff, 0x0fff]); +// This value is encoded differently by V8 depending on the CPU architecture, +// but the result can be read on any architecture. This code is tested in V8. +//testSerialization( 0x7fffffff, [0xfe49, 0xffff, 0x0fff]); +//testSerialization(-0x80000000, [0xff49, 0xffff, 0x0fff]); +testSerialization( 0x80000000, [0x004e, 0x0000, 0x0000, 0xe000, 0x0041]); +testSerialization( 0xffffffff, [0x004e, 0xe000, 0xffff, 0xefff, 0x0041]); -testSerialization("", [0x003f, 0x0053]); -testSerialization("abc", [0x003f, 0x0353, 0x6261, 0x0063]); -testSerialization({integer: 123}, [0x003f, 0x3f6f, 0x5301, 0x6907, 0x746e, - 0x6765, 0x7265, 0x013f, 0xf649, 0x7b01, - 0x0001]); -testSerialization({string: "str"}, [0x003f, 0x3f6f, 0x5301, 0x7306, 0x7274, - 0x6e69, 0x3f67, 0x5301, 0x7303, 0x7274, - 0x017b]); -testSerialization({list: [1,2,3]}, [0x003f, 0x3f6f, 0x5301, 0x6c04, 0x7369, - 0x3f74, 0x4101, 0x3f03, 0x4902, 0x3f02, - 0x4902, 0x3f04, 0x4902, 0x2406, 0x0300, - 0x017b]); -testSerialization(null, [0x003f, 0x0030]); -testSerialization(/abc/, [0x003f, 0x0352, 0x6261, 0x0063]); +testSerialization("", [0x0053]); +testSerialization("abc", [0x0353, 0x6261, 0x0063]); +testSerialization({integer: 123}, [0x536f, 0x6907, 0x746e, 0x6765, 0x7265, + 0xf649, 0x7b01, 0x0001]); +testSerialization({string: "str"}, [0x536f, 0x7306, 0x7274, 0x6e69, 0x5367, + 0x7303, 0x7274, 0x017b]); +testSerialization({list: [1,2,3]}, [0x536f, 0x6c04, 0x7369, 0x4174, 0x4903, + 0x4902, 0x4904, 0x2406, 0x0300, 0x017b]); +testSerialization(null, [0x0030]); +testSerialization(/abc/, [0x0352, 0x6261, 0x0063]); var innerObject = {hello: "there"}; var outerObject = {inner: innerObject}; outerObject['outer'] = innerObject; -testSerialization(outerObject, [0x003f, 0x3f6f, 0x5301, 0x6905, 0x6e6e, - 0x7265, 0x013f, 0x3f6f, 0x5302, 0x6805, - 0x6c65, 0x6f6c, 0x023f, 0x0553, 0x6874, - 0x7265, 0x7b65, 0x3f01, 0x5302, 0x6f05, - 0x7475, 0x7265, 0x023f, 0x015e, 0x027b]); -testSerialization(innerObject, [0x003f, 0x3f6f, 0x5301, 0x6805, 0x6c65, - 0x6f6c, 0x013f, 0x0553, 0x6874, 0x7265, - 0x7b65, 0x0001]); +testSerialization(outerObject, [0x536f, 0x6905, 0x6e6e, 0x7265, 0x536f, + 0x6805, 0x6c65, 0x6f6c, 0x0553, 0x6874, + 0x7265, 0x7b65, 0x5301, 0x6f05, 0x7475, + 0x7265, 0x015e, 0x027b]); +testSerialization(innerObject, [0x536f, 0x6805, 0x6c65, 0x6f6c, 0x0553, + 0x6874, 0x7265, 0x7b65, 0x0001]); var unicodeObject = {a: 'a', u: String.fromCharCode(0x03B1,0x03B2), d: 42}; testSerialization(unicodeObject, - [0x003f, 0x3f6f, 0x5301, 0x6101, 0x013f, - 0x0153, 0x3f61, 0x5301, 0x7501, 0x013f, - 0x0463, 0x03b1, 0x03b2, 0x013f, 0x0153, - 0x3f64, 0x4901, 0x7b54, 0x0003], + [0x536f, 0x6101, 0x0153, 0x5361, 0x7501, 0x0463, 0x03b1, + 0x03b2, 0x0153, 0x4964, 0x7b54, 0x0003], [0x01ff, 0x003f, 0x3f6f, 0x5301, 0x6101, 0x013f, 0x0153, 0x3f61, 0x5301, 0x7501, 0x013f, 0x0453, 0xb1ce, 0xb2ce, 0x013f, 0x0153, 0x3f64, 0x4901, 0x7b54, 0x0003]); unicodeObject.a = 'ab'; testSerialization(unicodeObject, - [0x003f, 0x3f6f, 0x5301, 0x6101, 0x013f, - 0x0253, 0x6261, 0x013f, 0x0153, 0x3f75, - 0x0001, 0x0463, 0x03b1, 0x03b2, 0x013f, - 0x0153, 0x3f64, 0x4901, 0x7b54, 0x0003], + [0x536f, 0x6101, 0x0253, 0x6261, 0x0153, 0x0075, 0x0463, + 0x03b1, 0x03b2, 0x0153, 0x4964, 0x7b54, 0x0003], [0x01ff, 0x003f, 0x3f6f, 0x5301, 0x6101, 0x013f, 0x0253, 0x6261, 0x013f, 0x0153, 0x3f75, 0x5301, 0xce04, 0xceb1, 0x3fb2, @@ -124,11 +112,8 @@ arrayObject['bar'] = 456; arrayObject[''] = null; testSerialization(arrayObject, - [0x003f, 0x0041, 0x013f, 0x0153, 0x3f61, - 0x5401, 0x013f, 0x0153, 0x3f62, 0x4601, - 0x013f, 0x0353, 0x6f66, 0x3f6f, 0x4901, - 0x01f6, 0x013f, 0x0353, 0x6162, 0x3f72, - 0x4901, 0x0790, 0x013f, 0x0053, 0x013f, + [0x0041, 0x0153, 0x5461, 0x0153, 0x4662, 0x0353, 0x6f66, + 0x496f, 0x01f6, 0x0353, 0x6162, 0x4972, 0x0790, 0x0053, 0x2430, 0x0005], [0x02ff, 0x003f, 0x0041, 0x013f, 0x0153, // deserialize from v2 0x3f61, 0x5401, 0x013f, 0x0153, 0x3f62, @@ -140,13 +125,9 @@ arrayObject[0] = 'foo'; arrayObject[1] = 'bar'; testSerialization(arrayObject, - [0x003f, 0x0241, 0x013f, 0x0353, 0x6f66, - 0x3f6f, 0x5301, 0x6203, 0x7261, 0x013f, - 0x0153, 0x3f61, 0x5401, 0x013f, 0x0153, - 0x3f62, 0x4601, 0x013f, 0x0353, 0x6f66, - 0x3f6f, 0x4901, 0x01f6, 0x013f, 0x0353, - 0x6162, 0x3f72, 0x4901, 0x0790, 0x013f, - 0x0053, 0x013f, 0x2430, 0x0205], + [0x0241, 0x0353, 0x6f66, 0x536f, 0x6203, 0x7261, 0x0153, + 0x5461, 0x0153, 0x4662, 0x0353, 0x6f66, 0x496f, 0x01f6, + 0x0353, 0x6162, 0x4972, 0x0790, 0x0053, 0x2430, 0x0205], [0x01ff, 0x003f, 0x0241, 0x013f, 0x0353, 0x6f66, 0x3f6f, 0x5301, 0x6203, 0x7261, 0x013f, 0x0153, 0x3f61, 0x5401, 0x013f,
diff --git a/third_party/WebKit/LayoutTests/fast/workers/worker-formdata-expected.txt b/third_party/WebKit/LayoutTests/fast/workers/worker-formdata-expected.txt index f18a766..7bf8dfb 100644 --- a/third_party/WebKit/LayoutTests/fast/workers/worker-formdata-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/workers/worker-formdata-expected.txt
@@ -12,7 +12,7 @@ PASS [Worker] blob is non-null. PASS [Worker] formData.append('key', blob); did not throw exception. PASS [Worker] formData.append('key', blob, 'filename'); did not throw exception. -PASS [Worker] postMessage(formData) threw exception DataCloneError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': An object could not be cloned.. +PASS [Worker] postMessage(formData) threw exception DataCloneError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': FormData object could not be cloned.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js b/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js index ee1225d..e712c32 100644 --- a/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js +++ b/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js
@@ -2,7 +2,7 @@ let mockImageCaptureReady = define( 'mockImageCapture', - ['media/mojo/interfaces/image_capture.mojom', + ['media/capture/mojo/image_capture.mojom', 'mojo/public/js/bindings', 'mojo/public/js/connection', 'content/public/renderer/interfaces',
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/fallback-myanmar.html b/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/fallback-myanmar.html new file mode 100644 index 0000000..b286bce --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/fallback-myanmar.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<meta charset="UTF-8"> +<head> + <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> + <script type="text/javascript" src="../../http/tests/inspector-protocol/css-protocol-test.js"></script> + <script type="text/javascript" src="../../http/tests/inspector-protocol/dom-protocol-test.js"></script> + <script type="text/javascript" src="resources/layout-font-test.js"></script> +</head> +<script> +function postTestHookWithFontResults(results) { + var el = document.createElement("div"); + var passed = (results['#myanmar'].length == 1 && + results['#myanmar'][0].familyName.includes("Myanmar")) || + (results['#myanmar'].length == 2 && + results['#myanmar'][0].glyphCount == 2 && + results['#myanmar'][1].glyphCount > 10 && + results['#myanmar'][1].familyName.includes("Myanmar")); + el.innerHTML = passed ? "PASS" : "FAIL"; + document.body.appendChild(el); +} +</script> +<body> + Test passes if a maxmium of the two first glyphs are notdef's (for Myanmar fonts that do not combine a left quote + with a Myanmar spacing mark and the rest of the run is shaped, given a system Myanmar font is available. + <div class="test"> + <div lang="my" id="myanmar">‘ေရွးျမန္မာမင္းေတြလက္ထက္က</div> + </div> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/resources/layout-font-test.js b/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/resources/layout-font-test.js index cc36025..f3efc86 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/resources/layout-font-test.js +++ b/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/resources/layout-font-test.js
@@ -51,6 +51,10 @@ InspectorTest.evaluateInInspectedPage("injectCollectedResultsInPage(" + JSON.stringify(collectedFontUsage) + ")"); + InspectorTest.evaluateInInspectedPage("postTestHookWithFontResults(" + + JSON.stringify(collectedFontUsage) + + ")"); + } function platformFontsForElementWithSelector(selector)
diff --git a/third_party/WebKit/LayoutTests/platform/mac/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt new file mode 100644 index 0000000..2442969 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt
@@ -0,0 +1,6 @@ +Test passes if a maxmium of the two first glyphs are notdef's (for Myanmar fonts that do not combine a left quote with a Myanmar spacing mark and the rest of the run is shaped, given a system Myanmar font is available. +‘ေရွးျမန္မာမင္းေတြလက္ထက္က +#myanmar: +"Myanmar MN" : 22 + +PASS
diff --git a/third_party/WebKit/LayoutTests/platform/win/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt b/third_party/WebKit/LayoutTests/platform/win/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt new file mode 100644 index 0000000..e2d3277 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt
@@ -0,0 +1,6 @@ +Test passes if a maxmium of the two first glyphs are notdef's (for Myanmar fonts that do not combine a left quote with a Myanmar spacing mark and the rest of the run is shaped, given a system Myanmar font is available. +‘ေရွးျမန္မာမင္းေတြလက္ထက္က +#myanmar: +"Myanmar Text" : 26 + +PASS
diff --git a/third_party/WebKit/LayoutTests/platform/win7/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt new file mode 100644 index 0000000..b1c7fce --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/inspector-protocol/layout-fonts/fallback-myanmar-expected.txt
@@ -0,0 +1,6 @@ +Test passes if a maxmium of the two first glyphs are notdef's (for Myanmar fonts that do not combine a left quote with a Myanmar spacing mark and the rest of the run is shaped, given a system Myanmar font is available. +‘ေရွးျမန္မာမင္းေတြလက္ထက္က +#myanmar: +"Arial" : 25 + +FAIL
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/clone-exception-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/clone-exception-expected.txt index 9f4aeb68..5a44c34 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/clone-exception-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/clone-exception-expected.txt
@@ -13,7 +13,7 @@ PASS Exception was thrown. PASS code is 25 PASS ename is 'DataCloneError' -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': #<Window> could not be cloned. doSecondOpen(): indexedDB.open(dbname + '2') @@ -23,7 +23,7 @@ PASS Exception was thrown. PASS code is 25 PASS ename is 'DataCloneError' -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': #<Window> could not be cloned. doThirdOpen(): indexedDB.open(dbname + '3') @@ -33,7 +33,7 @@ PASS Exception was thrown. PASS code is 25 PASS ename is 'DataCloneError' -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': #<Window> could not be cloned. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt index 7467afb..a40c20a1 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt
@@ -162,7 +162,7 @@ Expecting exception from store.add(self, 0) PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'add' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'add' on 'IDBObjectStore': #<Window> could not be cloned. IDBObjectStore.clear() This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly". @@ -321,7 +321,7 @@ Expecting exception from store.put(self, 0) PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': #<Window> could not be cloned. db.close() ro_transaction.oncomplete = transactionComplete rw_transaction.oncomplete = transactionComplete @@ -581,7 +581,7 @@ Expecting exception from cursor.update(self) PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'update' on 'IDBCursor': An object could not be cloned. +Exception message: Failed to execute 'update' on 'IDBCursor': #<Window> could not be cloned. The transaction this IDBCursor belongs to is not active. Expecting exception from cursorFromInactiveTransaction.update({}) PASS Exception was thrown.
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt index 2994471..16fac6ac3 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -95,7 +95,7 @@ Expecting exception from store.add({x: 'bar', y: self}, 'bar') PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'add' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'add' on 'IDBObjectStore': #<Window> could not be cloned. Try to insert data where key path yields a Date key: store.add({x: testDateB, y: 'value'}, 'key') addSuccess():
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt index b4c1bdf..407e20c2 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt
@@ -96,7 +96,7 @@ [Worker] Expecting exception from store.add({x: 'bar', y: self}, 'bar') PASS [Worker] Exception was thrown. PASS [Worker] code is DOMException.DATA_CLONE_ERR -[Worker] Exception message: Failed to execute 'add' on 'IDBObjectStore': An object could not be cloned. +[Worker] Exception message: Failed to execute 'add' on 'IDBObjectStore': #<DedicatedWorkerGlobalScope> could not be cloned. [Worker] Try to insert data where key path yields a Date key: [Worker] store.add({x: testDateB, y: 'value'}, 'key') [Worker] addSuccess():
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/structured-clone-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/structured-clone-expected.txt index 70bdc06..2dbdd53 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/structured-clone-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/structured-clone-expected.txt
@@ -838,25 +838,27 @@ Expecting exception from store.put(new Error, 'key') PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': Error could not be cloned. Expecting exception from store.put(new Function, 'key') PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': function anonymous() { + +} could not be cloned. Other host object types: Expecting exception from store.put(self, 'key') PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': #<Window> could not be cloned. Expecting exception from store.put(document, 'key') PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': HTMLDocument object could not be cloned. Expecting exception from store.put(document.body, 'key') PASS Exception was thrown. PASS code is DOMException.DATA_CLONE_ERR -Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned. +Exception message: Failed to execute 'put' on 'IDBObjectStore': HTMLBodyElement object could not be cloned. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/animation-finish-promise-gc.html b/third_party/WebKit/LayoutTests/web-animations-api/animation-finish-promise-gc.html deleted file mode 100644 index 3ef98fe8..0000000 --- a/third_party/WebKit/LayoutTests/web-animations-api/animation-finish-promise-gc.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<meta charset=utf-8> -<title>Garbage collect an animation with a finish promise</title> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<body> -<script> -function gc() -{ - return GCController.collectAll(); -} - -async_test(t => { - assert_exists(window, "GCController", "gc controller needed"); - setInterval(gc, 0); - - var anim = document.body.animate(null, 1); - var promise = anim.finished; - - promise.then(() => { - t.done(); - }); -}, 'Animation finish promise resolved if animation is garbage collected'); -</script> -</body>
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp index d380895..a65c0b7 100644 --- a/third_party/WebKit/Source/core/animation/Animation.cpp +++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -651,11 +651,7 @@ } bool Animation::hasPendingActivity() const { - bool hasPendingPromise = - m_finishedPromise && - m_finishedPromise->getState() == ScriptPromisePropertyBase::Pending; - - return m_pendingFinishedEvent || hasPendingPromise || + return m_pendingFinishedEvent || (!m_finished && hasEventListeners(EventTypeNames::finish)); }
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp index b8e64992..0dae78e0 100644 --- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp +++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -507,8 +507,10 @@ clear(); if (!errorOccurred()) setStatus(DecodeError); - if (!allDataReceived && loader()) - loader()->didFinishLoading(nullptr, monotonicallyIncreasingTime(), size); + if (!allDataReceived && loader()) { + loader()->didFinishLoading(nullptr, monotonicallyIncreasingTime(), size, + size); + } memoryCache()->remove(this); }
diff --git a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp index 4cbb5e17..dacca2c 100644 --- a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp +++ b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
@@ -283,7 +283,7 @@ // This part finishes. The image is created, callbacks are sent, and the data // buffer is cleared. - cachedImage->loader()->didFinishLoading(nullptr, 0.0, 0); + cachedImage->loader()->didFinishLoading(nullptr, 0.0, 0, 0); EXPECT_TRUE(cachedImage->resourceBuffer()); EXPECT_FALSE(cachedImage->errorOccurred()); ASSERT_TRUE(cachedImage->hasImage()); @@ -441,8 +441,9 @@ nullptr, WrappedResourceResponse(resourceResponse), nullptr); cachedImage->loader()->didReceiveData( nullptr, reinterpret_cast<const char*>(kJpegImage2), sizeof(kJpegImage2), - sizeof(kJpegImage2), sizeof(kJpegImage2)); - cachedImage->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage2)); + sizeof(kJpegImage2)); + cachedImage->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage2), + sizeof(kJpegImage2)); EXPECT_FALSE(cachedImage->errorOccurred()); ASSERT_TRUE(cachedImage->hasImage()); EXPECT_FALSE(cachedImage->getImage()->isNull()); @@ -479,7 +480,7 @@ nullptr, WrappedResourceResponse(initialResourceResponse)); cachedImage->loader()->didReceiveData( nullptr, reinterpret_cast<const char*>(kJpegImage), sizeof(kJpegImage), - sizeof(kJpegImage), sizeof(kJpegImage)); + sizeof(kJpegImage)); EXPECT_FALSE(cachedImage->errorOccurred()); ASSERT_TRUE(cachedImage->hasImage()); @@ -509,8 +510,9 @@ nullptr); cachedImage->loader()->didReceiveData( nullptr, reinterpret_cast<const char*>(kJpegImage2), sizeof(kJpegImage2), - sizeof(kJpegImage2), sizeof(kJpegImage2)); - cachedImage->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage2)); + sizeof(kJpegImage2)); + cachedImage->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage2), + sizeof(kJpegImage2)); EXPECT_FALSE(cachedImage->errorOccurred()); ASSERT_TRUE(cachedImage->hasImage()); @@ -553,9 +555,9 @@ image->loader()->didReceiveData(nullptr, reinterpret_cast<const char*>(kJpegImage), kJpegImageSubrangeWithDimensionsLength, - kJpegImageSubrangeWithDimensionsLength, kJpegImageSubrangeWithDimensionsLength); image->loader()->didFinishLoading(nullptr, 0.0, + kJpegImageSubrangeWithDimensionsLength, kJpegImageSubrangeWithDimensionsLength); EXPECT_EQ(Resource::Cached, image->getStatus()); @@ -844,8 +846,7 @@ nullptr, WrappedResourceResponse(ResourceResponse( testURL, "image/jpeg", 18, nullAtom, String())), nullptr); - cachedImage->loader()->didReceiveData(nullptr, "notactuallyanimage", 18, 18, - 18); + cachedImage->loader()->didReceiveData(nullptr, "notactuallyanimage", 18, 18); EXPECT_EQ(Resource::DecodeError, cachedImage->getStatus()); EXPECT_FALSE(cachedImage->isLoading()); } @@ -869,10 +870,11 @@ nullptr, WrappedResourceResponse(ResourceResponse( testURL, "image/jpeg", sizeof(kJpegImage), nullAtom, String()))); - image->loader()->didReceiveData( - nullptr, reinterpret_cast<const char*>(kJpegImage), sizeof(kJpegImage), - sizeof(kJpegImage), sizeof(kJpegImage)); - image->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage)); + image->loader()->didReceiveData(nullptr, + reinterpret_cast<const char*>(kJpegImage), + sizeof(kJpegImage), sizeof(kJpegImage)); + image->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage), + sizeof(kJpegImage)); EXPECT_EQ(Resource::Cached, image->getStatus()); EXPECT_EQ(sizeof(kJpegImage), image->encodedSize()); @@ -969,9 +971,9 @@ image->loader()->didReceiveData(nullptr, reinterpret_cast<const char*>(kJpegImage), kJpegImageSubrangeWithDimensionsLength, - kJpegImageSubrangeWithDimensionsLength, kJpegImageSubrangeWithDimensionsLength); image->loader()->didFinishLoading(nullptr, 0.0, + kJpegImageSubrangeWithDimensionsLength, kJpegImageSubrangeWithDimensionsLength); EXPECT_EQ(Resource::Cached, image->getStatus()); @@ -1016,7 +1018,7 @@ WrappedResourceResponse(ResourceResponse( testURL, "image/jpeg", sizeof(kBadData), nullAtom, String()))); image->loader()->didReceiveData(nullptr, kBadData, sizeof(kBadData), - sizeof(kBadData), sizeof(kBadData)); + sizeof(kBadData)); // The dimensions could not be extracted, so the full original image should be // loading. @@ -1031,10 +1033,11 @@ nullptr, WrappedResourceResponse(ResourceResponse( testURL, "image/jpeg", sizeof(kJpegImage), nullAtom, String()))); - image->loader()->didReceiveData( - nullptr, reinterpret_cast<const char*>(kJpegImage), sizeof(kJpegImage), - sizeof(kJpegImage), sizeof(kJpegImage)); - image->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage)); + image->loader()->didReceiveData(nullptr, + reinterpret_cast<const char*>(kJpegImage), + sizeof(kJpegImage), sizeof(kJpegImage)); + image->loader()->didFinishLoading(nullptr, 0.0, sizeof(kJpegImage), + sizeof(kJpegImage)); EXPECT_EQ(Resource::Cached, image->getStatus()); EXPECT_EQ(sizeof(kJpegImage), image->encodedSize()); @@ -1102,9 +1105,9 @@ image->loader()->didReceiveData(nullptr, reinterpret_cast<const char*>(kJpegImage), kJpegImageSubrangeWithDimensionsLength, - kJpegImageSubrangeWithDimensionsLength, kJpegImageSubrangeWithDimensionsLength); image->loader()->didFinishLoading(nullptr, 0.0, + kJpegImageSubrangeWithDimensionsLength, kJpegImageSubrangeWithDimensionsLength); EXPECT_EQ(Resource::Cached, image->getStatus());
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp index 38a79ac..a83cd453 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp +++ b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp
@@ -219,11 +219,9 @@ void ResourceLoader::didReceiveData(WebURLLoader*, const char* data, int length, - int encodedDataLength, - int encodedBodyLength) { + int encodedDataLength) { CHECK_GE(length, 0); m_fetcher->didReceiveData(m_resource.get(), data, length, encodedDataLength); - m_resource->addToEncodedBodyLength(encodedBodyLength); m_resource->addToDecodedBodyLength(length); m_resource->appendData(data, length); } @@ -235,8 +233,10 @@ void ResourceLoader::didFinishLoading(WebURLLoader*, double finishTime, - int64_t encodedDataLength) { + int64_t encodedDataLength, + int64_t encodedBodyLength) { m_resource->setEncodedDataLength(encodedDataLength); + m_resource->addToEncodedBodyLength(encodedBodyLength); m_loader.reset(); m_fetcher->didFinishLoading(m_resource.get(), finishTime, ResourceFetcher::DidFinishLoading); @@ -244,8 +244,10 @@ void ResourceLoader::didFail(WebURLLoader*, const WebURLError& error, - int64_t encodedDataLength) { + int64_t encodedDataLength, + int64_t encodedBodyLength) { m_resource->setEncodedDataLength(encodedDataLength); + m_resource->addToEncodedBodyLength(encodedBodyLength); didFail(error); } @@ -275,15 +277,16 @@ WebURLError errorOut; WebData dataOut; int64_t encodedDataLength = WebURLLoaderClient::kUnknownEncodedDataLength; + int64_t encodedBodyLength = 0; m_loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut, - encodedDataLength); + encodedDataLength, encodedBodyLength); // A message dispatched while synchronously fetching the resource // can bring about the cancellation of this load. if (!m_loader) return; if (errorOut.reason) { - didFail(0, errorOut, encodedDataLength); + didFail(0, errorOut, encodedDataLength, encodedBodyLength); return; } didReceiveResponse(0, responseOut); @@ -300,7 +303,8 @@ encodedDataLength); m_resource->setResourceBuffer(dataOut); } - didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); + didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength, + encodedBodyLength); } void ResourceLoader::activateCacheAwareLoadingIfNeeded(
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.h b/third_party/WebKit/Source/core/fetch/ResourceLoader.h index 64b66678..99fcfe9a 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceLoader.h +++ b/third_party/WebKit/Source/core/fetch/ResourceLoader.h
@@ -104,15 +104,16 @@ void didReceiveData(WebURLLoader*, const char*, int, - int encodedDataLength, - int encodedBodyLength) override; + int encodedDataLength) override; void didDownloadData(WebURLLoader*, int, int) override; void didFinishLoading(WebURLLoader*, double finishTime, - int64_t encodedDataLength) override; + int64_t encodedDataLength, + int64_t encodedBodyLength) override; void didFail(WebURLLoader*, const WebURLError&, - int64_t encodedDataLength) override; + int64_t encodedDataLength, + int64_t encodedBodyLength) override; void didFinishLoadingFirstPartInMultipart(); void didFail(const ResourceError&);
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp index 899562d..d501f9b 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -87,7 +87,7 @@ void CSPDirectiveList::reportViolation( const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType& effectiveType, const String& consoleMessage, const KURL& blockedURL, ResourceRequest::RedirectStatus redirectStatus) const { @@ -95,15 +95,15 @@ isReportOnly() ? "[Report Only] " + consoleMessage : consoleMessage; m_policy->logToConsole(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, message)); - m_policy->reportViolation(directiveText, effectiveDirective, message, - blockedURL, m_reportEndpoints, m_header, - m_headerType, ContentSecurityPolicy::URLViolation, - nullptr, redirectStatus); + m_policy->reportViolation(directiveText, effectiveType, message, blockedURL, + m_reportEndpoints, m_header, m_headerType, + ContentSecurityPolicy::URLViolation, nullptr, + redirectStatus); } void CSPDirectiveList::reportViolationWithFrame( const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType& effectiveType, const String& consoleMessage, const KURL& blockedURL, LocalFrame* frame) const { @@ -112,14 +112,14 @@ m_policy->logToConsole( ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, message), frame); - m_policy->reportViolation( - directiveText, effectiveDirective, message, blockedURL, m_reportEndpoints, - m_header, m_headerType, ContentSecurityPolicy::URLViolation, frame); + m_policy->reportViolation(directiveText, effectiveType, message, blockedURL, + m_reportEndpoints, m_header, m_headerType, + ContentSecurityPolicy::URLViolation, frame); } void CSPDirectiveList::reportViolationWithLocation( const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType& effectiveType, const String& consoleMessage, const KURL& blockedURL, const String& contextURL, @@ -131,14 +131,14 @@ SecurityMessageSource, ErrorMessageLevel, message, SourceLocation::capture(contextURL, contextLine.oneBasedInt(), 0))); m_policy->reportViolation( - directiveText, effectiveDirective, message, blockedURL, m_reportEndpoints, + directiveText, effectiveType, message, blockedURL, m_reportEndpoints, m_header, m_headerType, ContentSecurityPolicy::InlineViolation, nullptr, RedirectStatus::NoRedirect, contextLine.oneBasedInt(), element); } void CSPDirectiveList::reportViolationWithState( const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType& effectiveType, const String& message, const KURL& blockedURL, ScriptState* scriptState, @@ -154,9 +154,9 @@ SecurityMessageSource, ErrorMessageLevel, reportMessage); m_policy->logToConsole(consoleMessage); } - m_policy->reportViolation(directiveText, effectiveDirective, message, - blockedURL, m_reportEndpoints, m_header, - m_headerType, ContentSecurityPolicy::EvalViolation); + m_policy->reportViolation(directiveText, effectiveType, message, blockedURL, + m_reportEndpoints, m_header, m_headerType, + ContentSecurityPolicy::EvalViolation); } bool CSPDirectiveList::checkEval(SourceListDirective* directive) const { @@ -191,11 +191,12 @@ const KURL& mixedURL, ResourceRequest::RedirectStatus redirectStatus) const { if (strictMixedContentChecking()) { - m_policy->reportViolation(ContentSecurityPolicy::BlockAllMixedContent, - ContentSecurityPolicy::BlockAllMixedContent, - String(), mixedURL, m_reportEndpoints, m_header, - m_headerType, ContentSecurityPolicy::URLViolation, - nullptr, redirectStatus); + m_policy->reportViolation( + ContentSecurityPolicy::getDirectiveName( + ContentSecurityPolicy::DirectiveType::BlockAllMixedContent), + ContentSecurityPolicy::DirectiveType::BlockAllMixedContent, String(), + mixedURL, m_reportEndpoints, m_header, m_headerType, + ContentSecurityPolicy::URLViolation, nullptr, redirectStatus); } } @@ -282,8 +283,9 @@ break; } - reportViolation(ContentSecurityPolicy::RequireSRIFor, - ContentSecurityPolicy::RequireSRIFor, + reportViolation(ContentSecurityPolicy::getDirectiveName( + ContentSecurityPolicy::DirectiveType::RequireSRIFor), + ContentSecurityPolicy::DirectiveType::RequireSRIFor, "Refused to load the " + resourceType + " '" + url.elidedString() + "' because 'require-sri-for' directive requires " @@ -340,7 +342,7 @@ "used as a fallback."; reportViolationWithState( - directive->text(), ContentSecurityPolicy::ScriptSrc, + directive->text(), ContentSecurityPolicy::DirectiveType::ScriptSrc, consoleMessage + "\"" + directive->text() + "\"." + suffix + "\n", KURL(), scriptState, exceptionStatus); if (!isReportOnly()) { @@ -369,9 +371,9 @@ // 'RedirectStatus::NoRedirect' is safe here, as we do the media type check // before actually loading data; this means that we shouldn't leak redirect // targets, as we won't have had a chance to redirect yet. - reportViolation(directive->text(), ContentSecurityPolicy::PluginTypes, - message + "\n", KURL(), - ResourceRequest::RedirectStatus::NoRedirect); + reportViolation( + directive->text(), ContentSecurityPolicy::DirectiveType::PluginTypes, + message + "\n", KURL(), ResourceRequest::RedirectStatus::NoRedirect); return denyIfEnforcingPolicy(); } @@ -405,8 +407,9 @@ } reportViolationWithLocation( - directive->text(), isScript ? ContentSecurityPolicy::ScriptSrc - : ContentSecurityPolicy::StyleSrc, + directive->text(), + isScript ? ContentSecurityPolicy::DirectiveType::ScriptSrc + : ContentSecurityPolicy::DirectiveType::StyleSrc, consoleMessage + "\"" + directive->text() + "\"." + suffix + "\n", KURL(), contextURL, contextLine, element); @@ -421,7 +424,7 @@ bool CSPDirectiveList::checkSourceAndReportViolation( SourceListDirective* directive, const KURL& url, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType& effectiveType, ResourceRequest::RedirectStatus redirectStatus) const { if (!directive) return true; @@ -433,33 +436,33 @@ // We should never have a violation against `child-src` or `default-src` // directly; the effective directive should always be one of the explicit // fetch directives. - DCHECK_NE(ContentSecurityPolicy::ChildSrc, effectiveDirective); - DCHECK_NE(ContentSecurityPolicy::DefaultSrc, effectiveDirective); + DCHECK_NE(ContentSecurityPolicy::DirectiveType::ChildSrc, effectiveType); + DCHECK_NE(ContentSecurityPolicy::DirectiveType::DefaultSrc, effectiveType); String prefix; - if (ContentSecurityPolicy::BaseURI == effectiveDirective) + if (ContentSecurityPolicy::DirectiveType::BaseURI == effectiveType) prefix = "Refused to set the document's base URI to '"; - else if (ContentSecurityPolicy::WorkerSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::WorkerSrc == effectiveType) prefix = "Refused to create a worker from '"; - else if (ContentSecurityPolicy::ConnectSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::ConnectSrc == effectiveType) prefix = "Refused to connect to '"; - else if (ContentSecurityPolicy::FontSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::FontSrc == effectiveType) prefix = "Refused to load the font '"; - else if (ContentSecurityPolicy::FormAction == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::FormAction == effectiveType) prefix = "Refused to send form data to '"; - else if (ContentSecurityPolicy::FrameSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::FrameSrc == effectiveType) prefix = "Refused to frame '"; - else if (ContentSecurityPolicy::ImgSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::ImgSrc == effectiveType) prefix = "Refused to load the image '"; - else if (ContentSecurityPolicy::MediaSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::MediaSrc == effectiveType) prefix = "Refused to load media from '"; - else if (ContentSecurityPolicy::ManifestSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::ManifestSrc == effectiveType) prefix = "Refused to load manifest from '"; - else if (ContentSecurityPolicy::ObjectSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::ObjectSrc == effectiveType) prefix = "Refused to load plugin data from '"; - else if (ContentSecurityPolicy::ScriptSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::ScriptSrc == effectiveType) prefix = "Refused to load the script '"; - else if (ContentSecurityPolicy::StyleSrc == effectiveDirective) + else if (ContentSecurityPolicy::DirectiveType::StyleSrc == effectiveType) prefix = "Refused to load the stylesheet '"; String suffix = String(); @@ -468,10 +471,11 @@ " 'strict-dynamic' is present, so host-based whitelisting is disabled."; if (directive == m_defaultSrc) suffix = - suffix + " Note that '" + effectiveDirective + + suffix + " Note that '" + + ContentSecurityPolicy::getDirectiveName(effectiveType) + "' was not explicitly set, so 'default-src' is used as a fallback."; - reportViolation(directive->text(), effectiveDirective, + reportViolation(directive->text(), effectiveType, prefix + url.elidedString() + "' because it violates the following Content Security " "Policy directive: \"" + @@ -487,7 +491,8 @@ if (checkAncestors(directive, frame)) return true; - reportViolationWithFrame(directive->text(), "frame-ancestors", + reportViolationWithFrame(directive->text(), + ContentSecurityPolicy::DirectiveType::FrameAncestors, "Refused to display '" + url.elidedString() + "' in a frame because an ancestor violates the " "following Content Security Policy directive: " @@ -613,7 +618,8 @@ return reportingStatus == ContentSecurityPolicy::SendReport ? checkSourceAndReportViolation( operativeDirective(m_scriptSrc.get()), url, - ContentSecurityPolicy::ScriptSrc, redirectStatus) + ContentSecurityPolicy::DirectiveType::ScriptSrc, + redirectStatus) : checkSource(operativeDirective(m_scriptSrc.get()), url, redirectStatus); } @@ -627,7 +633,8 @@ return reportingStatus == ContentSecurityPolicy::SendReport ? checkSourceAndReportViolation( operativeDirective(m_objectSrc.get()), url, - ContentSecurityPolicy::ObjectSrc, redirectStatus) + ContentSecurityPolicy::DirectiveType::ObjectSrc, + redirectStatus) : checkSource(operativeDirective(m_objectSrc.get()), url, redirectStatus); } @@ -647,9 +654,10 @@ m_frameSrc.get(), operativeDirective(m_childSrc.get())); return reportingStatus == ContentSecurityPolicy::SendReport - ? checkSourceAndReportViolation(whichDirective, url, - ContentSecurityPolicy::FrameSrc, - redirectStatus) + ? checkSourceAndReportViolation( + whichDirective, url, + ContentSecurityPolicy::DirectiveType::FrameSrc, + redirectStatus) : checkSource(whichDirective, url, redirectStatus); } @@ -658,9 +666,9 @@ ResourceRequest::RedirectStatus redirectStatus, ContentSecurityPolicy::ReportingStatus reportingStatus) const { return reportingStatus == ContentSecurityPolicy::SendReport - ? checkSourceAndReportViolation(operativeDirective(m_imgSrc.get()), - url, ContentSecurityPolicy::ImgSrc, - redirectStatus) + ? checkSourceAndReportViolation( + operativeDirective(m_imgSrc.get()), url, + ContentSecurityPolicy::DirectiveType::ImgSrc, redirectStatus) : checkSource(operativeDirective(m_imgSrc.get()), url, redirectStatus); } @@ -675,7 +683,8 @@ return reportingStatus == ContentSecurityPolicy::SendReport ? checkSourceAndReportViolation( operativeDirective(m_styleSrc.get()), url, - ContentSecurityPolicy::StyleSrc, redirectStatus) + ContentSecurityPolicy::DirectiveType::StyleSrc, + redirectStatus) : checkSource(operativeDirective(m_styleSrc.get()), url, redirectStatus); } @@ -687,7 +696,8 @@ return reportingStatus == ContentSecurityPolicy::SendReport ? checkSourceAndReportViolation( operativeDirective(m_fontSrc.get()), url, - ContentSecurityPolicy::FontSrc, redirectStatus) + ContentSecurityPolicy::DirectiveType::FontSrc, + redirectStatus) : checkSource(operativeDirective(m_fontSrc.get()), url, redirectStatus); } @@ -699,7 +709,8 @@ return reportingStatus == ContentSecurityPolicy::SendReport ? checkSourceAndReportViolation( operativeDirective(m_mediaSrc.get()), url, - ContentSecurityPolicy::MediaSrc, redirectStatus) + ContentSecurityPolicy::DirectiveType::MediaSrc, + redirectStatus) : checkSource(operativeDirective(m_mediaSrc.get()), url, redirectStatus); } @@ -711,7 +722,8 @@ return reportingStatus == ContentSecurityPolicy::SendReport ? checkSourceAndReportViolation( operativeDirective(m_manifestSrc.get()), url, - ContentSecurityPolicy::ManifestSrc, redirectStatus) + ContentSecurityPolicy::DirectiveType::ManifestSrc, + redirectStatus) : checkSource(operativeDirective(m_manifestSrc.get()), url, redirectStatus); } @@ -723,7 +735,8 @@ return reportingStatus == ContentSecurityPolicy::SendReport ? checkSourceAndReportViolation( operativeDirective(m_connectSrc.get()), url, - ContentSecurityPolicy::ConnectSrc, redirectStatus) + ContentSecurityPolicy::DirectiveType::ConnectSrc, + redirectStatus) : checkSource(operativeDirective(m_connectSrc.get()), url, redirectStatus); } @@ -733,9 +746,10 @@ ResourceRequest::RedirectStatus redirectStatus, ContentSecurityPolicy::ReportingStatus reportingStatus) const { return reportingStatus == ContentSecurityPolicy::SendReport - ? checkSourceAndReportViolation(m_formAction.get(), url, - ContentSecurityPolicy::FormAction, - redirectStatus) + ? checkSourceAndReportViolation( + m_formAction.get(), url, + ContentSecurityPolicy::DirectiveType::FormAction, + redirectStatus) : checkSource(m_formAction.get(), url, redirectStatus); } @@ -744,9 +758,10 @@ ResourceRequest::RedirectStatus redirectStatus, ContentSecurityPolicy::ReportingStatus reportingStatus) const { return reportingStatus == ContentSecurityPolicy::SendReport - ? checkSourceAndReportViolation(m_baseURI.get(), url, - ContentSecurityPolicy::BaseURI, - redirectStatus) + ? checkSourceAndReportViolation( + m_baseURI.get(), url, + ContentSecurityPolicy::DirectiveType::BaseURI, + redirectStatus) : checkSource(m_baseURI.get(), url, redirectStatus); } @@ -762,9 +777,10 @@ m_workerSrc.get(), operativeDirective(m_childSrc.get())); return reportingStatus == ContentSecurityPolicy::SendReport - ? checkSourceAndReportViolation(whichDirective, url, - ContentSecurityPolicy::WorkerSrc, - redirectStatus) + ? checkSourceAndReportViolation( + whichDirective, url, + ContentSecurityPolicy::DirectiveType::WorkerSrc, + redirectStatus) : checkSource(whichDirective, url, redirectStatus); } @@ -997,7 +1013,8 @@ // Remove frame-ancestors directives in meta policies, per // https://www.w3.org/TR/CSP2/#delivery-html-meta-element. if (m_headerSource == ContentSecurityPolicyHeaderSourceMeta && - name == ContentSecurityPolicy::FrameAncestors) { + ContentSecurityPolicy::getDirectiveType(name) == + ContentSecurityPolicy::DirectiveType::FrameAncestors) { m_policy->reportInvalidDirectiveInMeta(name); return; } @@ -1082,60 +1099,64 @@ void CSPDirectiveList::addDirective(const String& name, const String& value) { ASSERT(!name.isEmpty()); - if (equalIgnoringCase(name, ContentSecurityPolicy::DefaultSrc)) { + ContentSecurityPolicy::DirectiveType type = + ContentSecurityPolicy::getDirectiveType(name); + if (type == ContentSecurityPolicy::DirectiveType::DefaultSrc) { setCSPDirective<SourceListDirective>(name, value, m_defaultSrc); // TODO(mkwst) It seems unlikely that developers would use different // algorithms for scripts and styles. We may want to combine the // usesScriptHashAlgorithms() and usesStyleHashAlgorithms. m_policy->usesScriptHashAlgorithms(m_defaultSrc->hashAlgorithmsUsed()); m_policy->usesStyleHashAlgorithms(m_defaultSrc->hashAlgorithmsUsed()); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::ScriptSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::ScriptSrc) { setCSPDirective<SourceListDirective>(name, value, m_scriptSrc); m_policy->usesScriptHashAlgorithms(m_scriptSrc->hashAlgorithmsUsed()); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::ObjectSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::ObjectSrc) { setCSPDirective<SourceListDirective>(name, value, m_objectSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::FrameAncestors)) { + } else if (type == + + ContentSecurityPolicy::DirectiveType::FrameAncestors) { setCSPDirective<SourceListDirective>(name, value, m_frameAncestors); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::FrameSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::FrameSrc) { setCSPDirective<SourceListDirective>(name, value, m_frameSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::ImgSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::ImgSrc) { setCSPDirective<SourceListDirective>(name, value, m_imgSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::StyleSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::StyleSrc) { setCSPDirective<SourceListDirective>(name, value, m_styleSrc); m_policy->usesStyleHashAlgorithms(m_styleSrc->hashAlgorithmsUsed()); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::FontSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::FontSrc) { setCSPDirective<SourceListDirective>(name, value, m_fontSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::MediaSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::MediaSrc) { setCSPDirective<SourceListDirective>(name, value, m_mediaSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::ConnectSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::ConnectSrc) { setCSPDirective<SourceListDirective>(name, value, m_connectSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::Sandbox)) { + } else if (type == ContentSecurityPolicy::DirectiveType::Sandbox) { applySandboxPolicy(name, value); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::ReportURI)) { + } else if (type == ContentSecurityPolicy::DirectiveType::ReportURI) { parseReportURI(name, value); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::BaseURI)) { + } else if (type == ContentSecurityPolicy::DirectiveType::BaseURI) { setCSPDirective<SourceListDirective>(name, value, m_baseURI); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::ChildSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::ChildSrc) { setCSPDirective<SourceListDirective>(name, value, m_childSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::WorkerSrc) && + } else if (type == ContentSecurityPolicy::DirectiveType::WorkerSrc && m_policy->experimentalFeaturesEnabled()) { setCSPDirective<SourceListDirective>(name, value, m_workerSrc); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::FormAction)) { + } else if (type == ContentSecurityPolicy::DirectiveType::FormAction) { setCSPDirective<SourceListDirective>(name, value, m_formAction); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::PluginTypes)) { + } else if (type == ContentSecurityPolicy::DirectiveType::PluginTypes) { setCSPDirective<MediaListDirective>(name, value, m_pluginTypes); - } else if (equalIgnoringCase( - name, ContentSecurityPolicy::UpgradeInsecureRequests)) { + } else if (type == + ContentSecurityPolicy::DirectiveType::UpgradeInsecureRequests) { enableInsecureRequestsUpgrade(name, value); - } else if (equalIgnoringCase(name, - ContentSecurityPolicy::BlockAllMixedContent)) { + } else if (type == + ContentSecurityPolicy::DirectiveType::BlockAllMixedContent) { enforceStrictMixedContentChecking(name, value); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::ManifestSrc)) { + } else if (type == ContentSecurityPolicy::DirectiveType::ManifestSrc) { setCSPDirective<SourceListDirective>(name, value, m_manifestSrc); - } else if (equalIgnoringCase(name, - ContentSecurityPolicy::TreatAsPublicAddress)) { + } else if (type == + ContentSecurityPolicy::DirectiveType::TreatAsPublicAddress) { treatAsPublicAddress(name, value); - } else if (equalIgnoringCase(name, ContentSecurityPolicy::RequireSRIFor) && + } else if (type == ContentSecurityPolicy::DirectiveType::RequireSRIFor && m_policy->experimentalFeaturesEnabled()) { parseRequireSRIFor(name, value); } else { @@ -1143,6 +1164,103 @@ } } +SourceListDirective* CSPDirectiveList::operativeDirective( + const ContentSecurityPolicy::DirectiveType& type) { + switch (type) { + // Directives that do not have a default directive. + case ContentSecurityPolicy::DirectiveType::BaseURI: + return m_baseURI.get(); + case ContentSecurityPolicy::DirectiveType::DefaultSrc: + return m_defaultSrc.get(); + case ContentSecurityPolicy::DirectiveType::FrameAncestors: + return m_frameAncestors.get(); + case ContentSecurityPolicy::DirectiveType::FormAction: + return m_formAction.get(); + // Directives that have one default directive. + case ContentSecurityPolicy::DirectiveType::ChildSrc: + return operativeDirective(m_childSrc.get()); + case ContentSecurityPolicy::DirectiveType::ConnectSrc: + return operativeDirective(m_connectSrc.get()); + case ContentSecurityPolicy::DirectiveType::FontSrc: + return operativeDirective(m_fontSrc.get()); + case ContentSecurityPolicy::DirectiveType::ImgSrc: + return operativeDirective(m_imgSrc.get()); + case ContentSecurityPolicy::DirectiveType::ManifestSrc: + return operativeDirective(m_manifestSrc.get()); + case ContentSecurityPolicy::DirectiveType::MediaSrc: + return operativeDirective(m_mediaSrc.get()); + case ContentSecurityPolicy::DirectiveType::ObjectSrc: + return operativeDirective(m_objectSrc.get()); + case ContentSecurityPolicy::DirectiveType::ScriptSrc: + return operativeDirective(m_scriptSrc.get()); + case ContentSecurityPolicy::DirectiveType::StyleSrc: + return operativeDirective(m_styleSrc.get()); + // Directives that default to child-src, which defaults to default-src. + case ContentSecurityPolicy::DirectiveType::FrameSrc: + return operativeDirective(m_frameSrc, + operativeDirective(m_childSrc.get())); + // TODO(mkwst): Reevaluate this + case ContentSecurityPolicy::DirectiveType::WorkerSrc: + return operativeDirective(m_workerSrc.get(), + operativeDirective(m_childSrc.get())); + default: + return nullptr; + } +} + +SourceListDirectiveVector CSPDirectiveList::getSourceVector( + const ContentSecurityPolicy::DirectiveType& type, + const CSPDirectiveListVector& policies) { + SourceListDirectiveVector sourceListDirectives; + for (const auto& policy : policies) { + if (SourceListDirective* directive = policy->operativeDirective(type)) + sourceListDirectives.append(directive); + } + + return sourceListDirectives; +} + +bool CSPDirectiveList::subsumes(const CSPDirectiveListVector& other) { + // A white-list of directives that we consider for subsumption. + // See more about source lists here: + // https://w3c.github.io/webappsec-csp/#framework-directive-source-list + ContentSecurityPolicy::DirectiveType directives[] = { + ContentSecurityPolicy::DirectiveType::ChildSrc, + ContentSecurityPolicy::DirectiveType::ConnectSrc, + ContentSecurityPolicy::DirectiveType::FontSrc, + ContentSecurityPolicy::DirectiveType::FrameSrc, + ContentSecurityPolicy::DirectiveType::ImgSrc, + ContentSecurityPolicy::DirectiveType::ManifestSrc, + ContentSecurityPolicy::DirectiveType::MediaSrc, + ContentSecurityPolicy::DirectiveType::ObjectSrc, + ContentSecurityPolicy::DirectiveType::ScriptSrc, + ContentSecurityPolicy::DirectiveType::StyleSrc, + ContentSecurityPolicy::DirectiveType::WorkerSrc, + ContentSecurityPolicy::DirectiveType::BaseURI, + ContentSecurityPolicy::DirectiveType::FrameAncestors, + ContentSecurityPolicy::DirectiveType::FormAction}; + + for (const auto& directive : directives) { + // There should only be one SourceListDirective for each directive in + // Embedding-CSP. + SourceListDirectiveVector requiredList = + getSourceVector(directive, CSPDirectiveListVector(1, this)); + if (requiredList.size() == 0) + continue; + SourceListDirective* required = requiredList[0]; + // Aggregate all serialized source lists of the returned CSP into a vector + // based on a directive type, defaulting accordingly (for example, to + // `default-src`). + SourceListDirectiveVector returned = getSourceVector(directive, other); + // TODO(amalika): Add checks for plugin-types, sandbox, disown-opener, + // navigation-to, worker-src. + if (!required->subsumes(returned)) + return false; + } + + return true; +} + DEFINE_TRACE(CSPDirectiveList) { visitor->trace(m_policy); visitor->trace(m_pluginTypes);
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h index b305e5b81..6be282e 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
@@ -22,6 +22,8 @@ class ContentSecurityPolicy; +typedef HeapVector<Member<SourceListDirective>> SourceListDirectiveVector; + class CORE_EXPORT CSPDirectiveList : public GarbageCollectedFinalized<CSPDirectiveList> { WTF_MAKE_NONCOPYABLE(CSPDirectiveList); @@ -156,10 +158,16 @@ bool shouldSendCSPHeader(Resource::Type) const; + // The algorithm is described here: + // https://w3c.github.io/webappsec-csp/embedded/#subsume-policy + bool subsumes(const CSPDirectiveListVector&); + DECLARE_TRACE(); private: FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, IsMatchingNoncePresent); + FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, GetSourceVector); + FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, OperativeDirectiveGivenType); enum RequireSRIForToken { None = 0, Script = 1 << 0, Style = 1 << 1 }; @@ -190,17 +198,17 @@ SourceListDirective* operativeDirective(SourceListDirective*, SourceListDirective* override) const; void reportViolation(const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType&, const String& consoleMessage, const KURL& blockedURL, ResourceRequest::RedirectStatus) const; void reportViolationWithFrame(const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType&, const String& consoleMessage, const KURL& blockedURL, LocalFrame*) const; void reportViolationWithLocation(const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType&, const String& consoleMessage, const KURL& blockedURL, const String& contextURL, @@ -208,7 +216,7 @@ Element*) const; void reportViolationWithState( const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType&, const String& message, const KURL& blockedURL, ScriptState*, @@ -247,10 +255,11 @@ bool isScript, const String& hashValue) const; - bool checkSourceAndReportViolation(SourceListDirective*, - const KURL&, - const String& effectiveDirective, - ResourceRequest::RedirectStatus) const; + bool checkSourceAndReportViolation( + SourceListDirective*, + const KURL&, + const ContentSecurityPolicy::DirectiveType&, + ResourceRequest::RedirectStatus) const; bool checkMediaTypeAndReportViolation(MediaListDirective*, const String& type, const String& typeAttribute, @@ -265,6 +274,17 @@ bool denyIfEnforcingPolicy() const { return isReportOnly(); } + // Tthis function returns a SourceListDirective of a given type + // or if it is not defined, the default SourceListDirective for that type. + SourceListDirective* operativeDirective( + const ContentSecurityPolicy::DirectiveType&); + + // This function aggregates from a vector of policies all operative + // SourceListDirectives of a given type into a vector. + static SourceListDirectiveVector getSourceVector( + const ContentSecurityPolicy::DirectiveType&, + const CSPDirectiveListVector& policies); + Member<ContentSecurityPolicy> m_policy; String m_header;
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp index 2fcde83..48c4aaee 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp
@@ -435,4 +435,327 @@ } } +TEST_F(CSPDirectiveListTest, SubsumesBasedOnCSPSourcesOnly) { + CSPDirectiveList* A = createList( + "script-src http://*.one.com; img-src https://one.com " + "http://two.com/imgs/", + ContentSecurityPolicyHeaderTypeEnforce); + + struct TestCase { + const std::vector<const char*> policies; + bool expected; + bool expectedFirstPolicyOpposite; + } cases[] = { + // `listB`, which is not as restrictive as `A`, is not subsumed. + {{""}, false, true}, + {{"script-src http://example.com"}, false, false}, + {{"img-src http://example.com"}, false, false}, + {{"script-src http://*.one.com"}, false, true}, + {{"img-src https://one.com http://two.com/imgs/"}, false, true}, + {{"default-src http://example.com"}, false, false}, + {{"default-src https://one.com http://two.com/imgs/"}, false, false}, + {{"default-src http://one.com"}, false, false}, + {{"script-src http://*.one.com; img-src http://two.com/"}, false, false}, + {{"script-src http://*.one.com", "img-src http://one.com"}, false, true}, + {{"script-src http://*.one.com", "script-src https://two.com"}, + false, + true}, + {{"script-src http://*.random.com", "script-src https://random.com"}, + false, + false}, + {{"script-src http://one.com", "script-src https://random.com"}, + false, + false}, + {{"script-src http://*.random.com; default-src http://one.com " + "http://two.com/imgs/", + "default-src https://random.com"}, + false, + false}, + // `listB`, which is as restrictive as `A`, is subsumed. + {{"default-src https://one.com"}, true, false}, + {{"default-src http://random.com", + "default-src https://non-random.com:*"}, + true, + false}, + {{"script-src http://*.one.com; img-src https://one.com"}, true, false}, + {{"script-src http://*.one.com; img-src https://one.com " + "http://two.com/imgs/"}, + true, + true}, + {{"script-src http://*.one.com", + "img-src https://one.com http://two.com/imgs/"}, + true, + true}, + {{"script-src http://*.random.com; default-src https://one.com " + "http://two.com/imgs/", + "default-src https://else.com"}, + true, + false}, + {{"script-src http://*.random.com; default-src https://one.com " + "http://two.com/imgs/", + "default-src https://one.com"}, + true, + false}, + }; + + CSPDirectiveList* emptyA = + createList("", ContentSecurityPolicyHeaderTypeEnforce); + + for (const auto& test : cases) { + HeapVector<Member<CSPDirectiveList>> listB; + for (const auto& policy : test.policies) { + listB.append(createList(policy, ContentSecurityPolicyHeaderTypeEnforce)); + } + + EXPECT_EQ(test.expected, A->subsumes(listB)); + // Empty CSPDirective subsumes any list. + EXPECT_TRUE(emptyA->subsumes(listB)); + // Check if first policy of `listB` subsumes `A`. + EXPECT_EQ(test.expectedFirstPolicyOpposite, + listB[0]->subsumes(HeapVector<Member<CSPDirectiveList>>(1, A))); + } +} + +TEST_F(CSPDirectiveListTest, OperativeDirectiveGivenType) { + enum DefaultBehaviour { Default, NoDefault, ChildAndDefault }; + + struct TestCase { + ContentSecurityPolicy::DirectiveType directive; + const DefaultBehaviour type; + } cases[] = { + // Directives with default directive. + {ContentSecurityPolicy::DirectiveType::ChildSrc, Default}, + {ContentSecurityPolicy::DirectiveType::ConnectSrc, Default}, + {ContentSecurityPolicy::DirectiveType::FontSrc, Default}, + {ContentSecurityPolicy::DirectiveType::ImgSrc, Default}, + {ContentSecurityPolicy::DirectiveType::ManifestSrc, Default}, + {ContentSecurityPolicy::DirectiveType::MediaSrc, Default}, + {ContentSecurityPolicy::DirectiveType::ObjectSrc, Default}, + {ContentSecurityPolicy::DirectiveType::ScriptSrc, Default}, + {ContentSecurityPolicy::DirectiveType::StyleSrc, Default}, + // Directives with no default directive. + {ContentSecurityPolicy::DirectiveType::BaseURI, NoDefault}, + {ContentSecurityPolicy::DirectiveType::DefaultSrc, NoDefault}, + {ContentSecurityPolicy::DirectiveType::FrameAncestors, NoDefault}, + {ContentSecurityPolicy::DirectiveType::FormAction, NoDefault}, + // Directive with multiple default directives. + {ContentSecurityPolicy::DirectiveType::FrameSrc, ChildAndDefault}, + {ContentSecurityPolicy::DirectiveType::WorkerSrc, ChildAndDefault}, + }; + + // Initial set-up. + std::stringstream allDirectives; + for (const auto& test : cases) { + const char* name = ContentSecurityPolicy::getDirectiveName(test.directive); + allDirectives << name << " http://" << name << ".com; "; + } + CSPDirectiveList* allDirectivesList = createList( + allDirectives.str().c_str(), ContentSecurityPolicyHeaderTypeEnforce); + CSPDirectiveList* empty = + createList("", ContentSecurityPolicyHeaderTypeEnforce); + + for (const auto& test : cases) { + const char* name = ContentSecurityPolicy::getDirectiveName(test.directive); + // When CSPDirectiveList is empty, then `null` should be returned for any + // type. + EXPECT_FALSE(empty->operativeDirective(test.directive)); + + // When all directives present, then given a type that directive value + // should be returned. + HeapVector<Member<CSPSource>> sources = + allDirectivesList->operativeDirective(test.directive)->m_list; + EXPECT_EQ(sources.size(), 1u); + EXPECT_TRUE(sources[0]->m_host.startsWith(name)); + + std::stringstream allExceptThis; + std::stringstream allExceptChildSrcAndThis; + for (const auto& subtest : cases) { + if (subtest.directive == test.directive) + continue; + const char* directiveName = + ContentSecurityPolicy::getDirectiveName(subtest.directive); + allExceptThis << directiveName << " http://" << directiveName << ".com; "; + if (subtest.directive != ContentSecurityPolicy::DirectiveType::ChildSrc) { + allExceptChildSrcAndThis << directiveName << " http://" << directiveName + << ".com; "; + } + } + CSPDirectiveList* allExceptThisList = createList( + allExceptThis.str().c_str(), ContentSecurityPolicyHeaderTypeEnforce); + CSPDirectiveList* allExceptChildSrcAndThisList = + createList(allExceptChildSrcAndThis.str().c_str(), + ContentSecurityPolicyHeaderTypeEnforce); + + switch (test.type) { + case Default: + sources = allExceptThisList->operativeDirective(test.directive)->m_list; + EXPECT_EQ(sources.size(), 1u); + EXPECT_EQ(sources[0]->m_host, "default-src.com"); + break; + case NoDefault: + EXPECT_FALSE(allExceptThisList->operativeDirective(test.directive)); + break; + case ChildAndDefault: + sources = allExceptThisList->operativeDirective(test.directive)->m_list; + EXPECT_EQ(sources.size(), 1u); + EXPECT_EQ(sources[0]->m_host, "child-src.com"); + sources = + allExceptChildSrcAndThisList->operativeDirective(test.directive) + ->m_list; + EXPECT_EQ(sources.size(), 1u); + EXPECT_EQ(sources[0]->m_host, "default-src.com"); + break; + } + } +} + +TEST_F(CSPDirectiveListTest, GetSourceVector) { + const std::vector<const char*> policies = { + // Policy 1 + "default-src https://default-src.com", + // Policy 2 + "child-src http://child-src.com", + // Policy 3 + "child-src http://child-src.com; default-src https://default-src.com", + // Policy 4 + "base-uri http://base-uri.com", + // Policy 5 + "frame-src http://frame-src.com"}; + + // Check expectations on the initial set-up. + HeapVector<Member<CSPDirectiveList>> policyVector; + for (const auto& policy : policies) { + policyVector.append( + createList(policy, ContentSecurityPolicyHeaderTypeEnforce)); + } + HeapVector<Member<SourceListDirective>> result = + CSPDirectiveList::getSourceVector( + ContentSecurityPolicy::DirectiveType::DefaultSrc, policyVector); + EXPECT_EQ(result.size(), 2u); + result = CSPDirectiveList::getSourceVector( + ContentSecurityPolicy::DirectiveType::ChildSrc, policyVector); + EXPECT_EQ(result.size(), 3u); + result = CSPDirectiveList::getSourceVector( + ContentSecurityPolicy::DirectiveType::BaseURI, policyVector); + EXPECT_EQ(result.size(), 1u); + result = CSPDirectiveList::getSourceVector( + ContentSecurityPolicy::DirectiveType::FrameSrc, policyVector); + EXPECT_EQ(result.size(), 4u); + + enum DefaultBehaviour { Default, NoDefault, ChildAndDefault }; + + struct TestCase { + ContentSecurityPolicy::DirectiveType directive; + const DefaultBehaviour type; + size_t expectedTotal; + int expectedCurrent; + int expectedDefaultSrc; + int expectedChildSrc; + } cases[] = { + // Directives with default directive. + {ContentSecurityPolicy::DirectiveType::ChildSrc, Default, 4u, 3, 1, 3}, + {ContentSecurityPolicy::DirectiveType::ConnectSrc, Default, 3u, 1, 2, 0}, + {ContentSecurityPolicy::DirectiveType::FontSrc, Default, 3u, 1, 2, 0}, + {ContentSecurityPolicy::DirectiveType::ImgSrc, Default, 3u, 1, 2, 0}, + {ContentSecurityPolicy::DirectiveType::ManifestSrc, Default, 3u, 1, 2, 0}, + {ContentSecurityPolicy::DirectiveType::MediaSrc, Default, 3u, 1, 2, 0}, + {ContentSecurityPolicy::DirectiveType::ObjectSrc, Default, 3u, 1, 2, 0}, + {ContentSecurityPolicy::DirectiveType::ScriptSrc, Default, 3u, 1, 2, 0}, + {ContentSecurityPolicy::DirectiveType::StyleSrc, Default, 3u, 1, 2, 0}, + // Directives with no default directive. + {ContentSecurityPolicy::DirectiveType::BaseURI, NoDefault, 2u, 2, 0, 0}, + {ContentSecurityPolicy::DirectiveType::FrameAncestors, NoDefault, 1u, 1, + 0, 0}, + {ContentSecurityPolicy::DirectiveType::FormAction, NoDefault, 1u, 1, 0, + 0}, + // Directive with multiple default directives. + {ContentSecurityPolicy::DirectiveType::FrameSrc, ChildAndDefault, 5u, 2, + 1, 2}, + }; + + for (const auto& test : cases) { + // Initial set-up. + HeapVector<Member<CSPDirectiveList>> policyVector; + for (const auto& policy : policies) { + policyVector.append( + createList(policy, ContentSecurityPolicyHeaderTypeEnforce)); + } + // Append current test's policy. + std::stringstream currentDirective; + const char* name = ContentSecurityPolicy::getDirectiveName(test.directive); + currentDirective << name << " http://" << name << ".com;"; + policyVector.append(createList(currentDirective.str().c_str(), + ContentSecurityPolicyHeaderTypeEnforce)); + + HeapVector<Member<SourceListDirective>> result = + CSPDirectiveList::getSourceVector(test.directive, policyVector); + + EXPECT_EQ(result.size(), test.expectedTotal); + + int actualCurrent = 0, actualDefault = 0, actualChild = 0; + for (const auto& srcList : result) { + HeapVector<Member<CSPSource>> sources = srcList->m_list; + for (const auto& source : sources) { + if (source->m_host.startsWith(name)) + actualCurrent += 1; + else if (source->m_host == "default-src.com") + actualDefault += 1; + + if (source->m_host == "child-src.com") + actualChild += 1; + } + } + + EXPECT_EQ(actualDefault, test.expectedDefaultSrc); + EXPECT_EQ(actualCurrent, test.expectedCurrent); + EXPECT_EQ(actualChild, test.expectedChildSrc); + + // If another default-src is added that should only impact Fetch Directives + policyVector.append(createList("default-src https://default-src.com;", + ContentSecurityPolicyHeaderTypeEnforce)); + size_t udpatedTotal = + test.type != NoDefault ? test.expectedTotal + 1 : test.expectedTotal; + EXPECT_EQ( + CSPDirectiveList::getSourceVector(test.directive, policyVector).size(), + udpatedTotal); + size_t expectedChildSrc = + test.directive == ContentSecurityPolicy::DirectiveType::ChildSrc ? 5u + : 4u; + EXPECT_EQ(CSPDirectiveList::getSourceVector( + ContentSecurityPolicy::DirectiveType::ChildSrc, policyVector) + .size(), + expectedChildSrc); + + // If another child-src is added that should only impact frame-src and + // child-src + policyVector.append(createList("child-src http://child-src.com;", + ContentSecurityPolicyHeaderTypeEnforce)); + udpatedTotal = + test.type == ChildAndDefault || + test.directive == ContentSecurityPolicy::DirectiveType::ChildSrc + ? udpatedTotal + 1 + : udpatedTotal; + EXPECT_EQ( + CSPDirectiveList::getSourceVector(test.directive, policyVector).size(), + udpatedTotal); + expectedChildSrc = expectedChildSrc + 1u; + EXPECT_EQ(CSPDirectiveList::getSourceVector( + ContentSecurityPolicy::DirectiveType::ChildSrc, policyVector) + .size(), + expectedChildSrc); + + // If we add sandbox, nothing should change since it is currenly not + // considered. + policyVector.append(createList("sandbox http://sandbox.com;", + ContentSecurityPolicyHeaderTypeEnforce)); + EXPECT_EQ( + CSPDirectiveList::getSourceVector(test.directive, policyVector).size(), + udpatedTotal); + EXPECT_EQ(CSPDirectiveList::getSourceVector( + ContentSecurityPolicy::DirectiveType::ChildSrc, policyVector) + .size(), + expectedChildSrc); + } +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSource.h b/third_party/WebKit/Source/core/frame/csp/CSPSource.h index fbab7058..b599e78 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPSource.h +++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.h
@@ -50,11 +50,13 @@ private: FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); + FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, Intersect); + FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IntersectSchemesOnly); FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSourcesSchemes); - FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, Intersect); - FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IntersectSchemesOnly); + FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, GetSourceVector); + FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, OperativeDirectiveGivenType); bool schemeMatches(const String&) const; bool hostMatches(const String&) const;
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index 34611c3..403a7fc 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -73,66 +73,6 @@ namespace blink { -// CSP Level 1 Directives -const char ContentSecurityPolicy::ConnectSrc[] = "connect-src"; -const char ContentSecurityPolicy::DefaultSrc[] = "default-src"; -const char ContentSecurityPolicy::FontSrc[] = "font-src"; -const char ContentSecurityPolicy::FrameSrc[] = "frame-src"; -const char ContentSecurityPolicy::ImgSrc[] = "img-src"; -const char ContentSecurityPolicy::MediaSrc[] = "media-src"; -const char ContentSecurityPolicy::ObjectSrc[] = "object-src"; -const char ContentSecurityPolicy::ReportURI[] = "report-uri"; -const char ContentSecurityPolicy::Sandbox[] = "sandbox"; -const char ContentSecurityPolicy::ScriptSrc[] = "script-src"; -const char ContentSecurityPolicy::StyleSrc[] = "style-src"; - -// CSP Level 2 Directives -const char ContentSecurityPolicy::BaseURI[] = "base-uri"; -const char ContentSecurityPolicy::ChildSrc[] = "child-src"; -const char ContentSecurityPolicy::FormAction[] = "form-action"; -const char ContentSecurityPolicy::FrameAncestors[] = "frame-ancestors"; -const char ContentSecurityPolicy::PluginTypes[] = "plugin-types"; - -// CSP Level 3 Directives -const char ContentSecurityPolicy::ManifestSrc[] = "manifest-src"; -const char ContentSecurityPolicy::WorkerSrc[] = "worker-src"; - -// Mixed Content Directive -// https://w3c.github.io/webappsec/specs/mixedcontent/#strict-mode -const char ContentSecurityPolicy::BlockAllMixedContent[] = - "block-all-mixed-content"; - -// https://w3c.github.io/webappsec/specs/upgrade/ -const char ContentSecurityPolicy::UpgradeInsecureRequests[] = - "upgrade-insecure-requests"; - -// https://mikewest.github.io/cors-rfc1918/#csp -const char ContentSecurityPolicy::TreatAsPublicAddress[] = - "treat-as-public-address"; - -// https://w3c.github.io/webappsec-subresource-integrity/#require-sri-for -const char ContentSecurityPolicy::RequireSRIFor[] = "require-sri-for"; - -bool ContentSecurityPolicy::isDirectiveName(const String& name) { - return ( - equalIgnoringCase(name, ConnectSrc) || - equalIgnoringCase(name, DefaultSrc) || equalIgnoringCase(name, FontSrc) || - equalIgnoringCase(name, FrameSrc) || equalIgnoringCase(name, ImgSrc) || - equalIgnoringCase(name, MediaSrc) || equalIgnoringCase(name, ObjectSrc) || - equalIgnoringCase(name, ReportURI) || equalIgnoringCase(name, Sandbox) || - equalIgnoringCase(name, ScriptSrc) || equalIgnoringCase(name, StyleSrc) || - equalIgnoringCase(name, BaseURI) || equalIgnoringCase(name, ChildSrc) || - equalIgnoringCase(name, FormAction) || - equalIgnoringCase(name, FrameAncestors) || - equalIgnoringCase(name, PluginTypes) || - equalIgnoringCase(name, ManifestSrc) || - equalIgnoringCase(name, WorkerSrc) || - equalIgnoringCase(name, BlockAllMixedContent) || - equalIgnoringCase(name, UpgradeInsecureRequests) || - equalIgnoringCase(name, TreatAsPublicAddress) || - equalIgnoringCase(name, RequireSRIFor)); -} - bool ContentSecurityPolicy::isNonceableElement(const Element* element) { if (!element->fastHasAttribute(HTMLNames::nonceAttr)) return false; @@ -1041,10 +981,11 @@ m_insecureRequestPolicy |= kUpgradeInsecureRequests; } -static String stripURLForUseInReport(ExecutionContext* context, - const KURL& url, - RedirectStatus redirectStatus, - const String& effectiveDirective) { +static String stripURLForUseInReport( + ExecutionContext* context, + const KURL& url, + RedirectStatus redirectStatus, + const ContentSecurityPolicy::DirectiveType& effectiveType) { if (!url.isValid()) return String(); if (!url.isHierarchical() || url.protocolIs("file")) @@ -1056,10 +997,8 @@ bool canSafelyExposeURL = context->getSecurityOrigin()->canRequest(url) || (redirectStatus == RedirectStatus::NoRedirect && - !equalIgnoringCase(effectiveDirective, - ContentSecurityPolicy::FrameSrc) && - !equalIgnoringCase(effectiveDirective, - ContentSecurityPolicy::ObjectSrc)); + effectiveType != ContentSecurityPolicy::DirectiveType::FrameSrc && + effectiveType != ContentSecurityPolicy::DirectiveType::ObjectSrc); if (canSafelyExposeURL) { // 'KURL::strippedForUseAsReferrer()' dumps 'String()' for non-webby URLs. @@ -1075,15 +1014,14 @@ SecurityPolicyViolationEventInit& init, ExecutionContext* context, const String& directiveText, - const String& effectiveDirective, + const ContentSecurityPolicy::DirectiveType& effectiveType, const KURL& blockedURL, const String& header, RedirectStatus redirectStatus, ContentSecurityPolicyHeaderType headerType, ContentSecurityPolicy::ViolationType violationType, int contextLine) { - if (equalIgnoringCase(effectiveDirective, - ContentSecurityPolicy::FrameAncestors)) { + if (effectiveType == ContentSecurityPolicy::DirectiveType::FrameAncestors) { // If this load was blocked via 'frame-ancestors', then the URL of // |document| has not yet been initialized. In this case, we'll set both // 'documentURI' and 'blockedURI' to the blocked document's URL. @@ -1100,11 +1038,13 @@ break; case ContentSecurityPolicy::URLViolation: init.setBlockedURI(stripURLForUseInReport( - context, blockedURL, redirectStatus, effectiveDirective)); + context, blockedURL, redirectStatus, effectiveType)); break; } } + String effectiveDirective = + ContentSecurityPolicy::getDirectiveName(effectiveType); init.setViolatedDirective(effectiveDirective); init.setEffectiveDirective(effectiveDirective); init.setOriginalPolicy(header); @@ -1129,8 +1069,8 @@ std::unique_ptr<SourceLocation> location = SourceLocation::capture(context); if (location->lineNumber()) { KURL source = KURL(ParsedURLString, location->url()); - init.setSourceFile(stripURLForUseInReport(context, source, redirectStatus, - effectiveDirective)); + init.setSourceFile( + stripURLForUseInReport(context, source, redirectStatus, effectiveType)); init.setLineNumber(location->lineNumber()); init.setColumnNumber(location->columnNumber()); } @@ -1138,7 +1078,7 @@ void ContentSecurityPolicy::reportViolation( const String& directiveText, - const String& effectiveDirective, + const DirectiveType& effectiveType, const String& consoleMessage, const KURL& blockedURL, const Vector<String>& reportEndpoints, @@ -1155,19 +1095,14 @@ // https://crbug.com/611232 (or move CSP child-src and frame-src checks to the // browser process - see https://crbug.com/376522). if (!m_executionContext && !contextFrame) { - DCHECK(equalIgnoringCase(effectiveDirective, - ContentSecurityPolicy::ChildSrc) || - equalIgnoringCase(effectiveDirective, - ContentSecurityPolicy::FrameSrc) || - equalIgnoringCase(effectiveDirective, - ContentSecurityPolicy::PluginTypes)); + DCHECK(effectiveType == DirectiveType::ChildSrc || + effectiveType == DirectiveType::FrameSrc || + effectiveType == DirectiveType::PluginTypes); return; } DCHECK((m_executionContext && !contextFrame) || - (equalIgnoringCase(effectiveDirective, - ContentSecurityPolicy::FrameAncestors) && - contextFrame)); + ((effectiveType == DirectiveType::FrameAncestors) && contextFrame)); SecurityPolicyViolationEventInit violationData; @@ -1177,9 +1112,8 @@ contextFrame ? contextFrame->document() : m_executionContext; DCHECK(relevantContext); gatherSecurityPolicyViolationEventData( - violationData, relevantContext, directiveText, effectiveDirective, - blockedURL, header, redirectStatus, headerType, violationType, - contextLine); + violationData, relevantContext, directiveText, effectiveType, blockedURL, + header, redirectStatus, headerType, violationType, contextLine); // TODO(mkwst): Obviously, we shouldn't hit this check, as extension-loaded // resources should be allowed regardless. We apparently do, however, so @@ -1266,8 +1200,8 @@ // document's URL. DCHECK(!contextFrame || !m_executionContext); DCHECK(!contextFrame || - equalIgnoringCase(violationData.effectiveDirective(), - FrameAncestors)); + getDirectiveType(violationData.effectiveDirective()) == + DirectiveType::FrameAncestors); KURL url = contextFrame ? frame->document()->completeURLWithOverride( @@ -1369,7 +1303,7 @@ message = optionsMessage; } else if (equalIgnoringCase(name, policyURI)) { message = policyURIMessage; - } else if (isDirectiveName(name)) { + } else if (getDirectiveType(name) != DirectiveType::Undefined) { message = "The Content-Security-Policy directive '" + name + "' is implemented behind a flag which is currently disabled.\n"; level = InfoMessageLevel; @@ -1556,4 +1490,109 @@ m_violationReportsSent.add(report.impl()->hash()); } +const char* ContentSecurityPolicy::getDirectiveName(const DirectiveType& type) { + switch (type) { + case DirectiveType::BaseURI: + return "base-uri"; + case DirectiveType::BlockAllMixedContent: + return "block-all-mixed-content"; + case DirectiveType::ChildSrc: + return "child-src"; + case DirectiveType::ConnectSrc: + return "connect-src"; + case DirectiveType::DefaultSrc: + return "default-src"; + case DirectiveType::FrameAncestors: + return "frame-ancestors"; + case DirectiveType::FrameSrc: + return "frame-src"; + case DirectiveType::FontSrc: + return "font-src"; + case DirectiveType::FormAction: + return "form-action"; + case DirectiveType::ImgSrc: + return "img-src"; + case DirectiveType::ManifestSrc: + return "manifest-src"; + case DirectiveType::MediaSrc: + return "media-src"; + case DirectiveType::ObjectSrc: + return "object-src"; + case DirectiveType::PluginTypes: + return "plugin-types"; + case DirectiveType::ReportURI: + return "report-uri"; + case DirectiveType::RequireSRIFor: + return "require-sri-for"; + case DirectiveType::Sandbox: + return "sandbox"; + case DirectiveType::ScriptSrc: + return "script-src"; + case DirectiveType::StyleSrc: + return "style-src"; + case DirectiveType::TreatAsPublicAddress: + return "treat-as-public-address"; + case DirectiveType::UpgradeInsecureRequests: + return "upgrade-insecure-requests"; + case DirectiveType::WorkerSrc: + return "worker-src"; + case DirectiveType::Undefined: + NOTREACHED(); + return ""; + } + + NOTREACHED(); + return ""; +} + +ContentSecurityPolicy::DirectiveType ContentSecurityPolicy::getDirectiveType( + const String& name) { + if (name == "base-uri") + return DirectiveType::BaseURI; + if (name == "block-all-mixed-content") + return DirectiveType::BlockAllMixedContent; + if (name == "child-src") + return DirectiveType::ChildSrc; + if (name == "connect-src") + return DirectiveType::ConnectSrc; + if (name == "default-src") + return DirectiveType::DefaultSrc; + if (name == "frame-ancestors") + return DirectiveType::FrameAncestors; + if (name == "frame-src") + return DirectiveType::FrameSrc; + if (name == "font-src") + return DirectiveType::FontSrc; + if (name == "form-action") + return DirectiveType::FormAction; + if (name == "img-src") + return DirectiveType::ImgSrc; + if (name == "manifest-src") + return DirectiveType::ManifestSrc; + if (name == "media-src") + return DirectiveType::MediaSrc; + if (name == "object-src") + return DirectiveType::ObjectSrc; + if (name == "plugin-types") + return DirectiveType::PluginTypes; + if (name == "report-uri") + return DirectiveType::ReportURI; + if (name == "require-sri-for") + return DirectiveType::RequireSRIFor; + if (name == "sandbox") + return DirectiveType::Sandbox; + if (name == "script-src") + return DirectiveType::ScriptSrc; + if (name == "style-src") + return DirectiveType::StyleSrc; + if (name == "treat-as-public-address") + return DirectiveType::TreatAsPublicAddress; + if (name == "upgrade-insecure-requests") + return DirectiveType::UpgradeInsecureRequests; + if (name == "worker-src") + return DirectiveType::WorkerSrc; + + return DirectiveType::Undefined; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h index a8f8033d..ad42feb 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h
@@ -72,43 +72,6 @@ class CORE_EXPORT ContentSecurityPolicy : public GarbageCollectedFinalized<ContentSecurityPolicy> { public: - // CSP Level 1 Directives - static const char ConnectSrc[]; - static const char DefaultSrc[]; - static const char FontSrc[]; - static const char FrameSrc[]; - static const char ImgSrc[]; - static const char MediaSrc[]; - static const char ObjectSrc[]; - static const char ReportURI[]; - static const char Sandbox[]; - static const char ScriptSrc[]; - static const char StyleSrc[]; - - // CSP Level 2 Directives - static const char BaseURI[]; - static const char ChildSrc[]; - static const char FormAction[]; - static const char FrameAncestors[]; - static const char PluginTypes[]; - - // CSP Level 3 Directives - static const char ManifestSrc[]; - static const char WorkerSrc[]; - - // Mixed Content Directive - // https://w3c.github.io/webappsec/specs/mixedcontent/#strict-mode - static const char BlockAllMixedContent[]; - - // https://w3c.github.io/webappsec/specs/upgrade/ - static const char UpgradeInsecureRequests[]; - - // https://mikewest.github.io/cors-rfc1918/#csp - static const char TreatAsPublicAddress[]; - - // https://w3c.github.io/webappsec-subresource-integrity/#require-sri-for - static const char RequireSRIFor[]; - enum ReportingStatus { SendReport, SuppressReport }; enum ExceptionStatus { WillThrowException, WillNotThrowException }; @@ -121,6 +84,32 @@ enum class InlineType { Block, Attribute }; + enum class DirectiveType { + Undefined, + BaseURI, + BlockAllMixedContent, + ChildSrc, + ConnectSrc, + DefaultSrc, + FrameAncestors, + FrameSrc, + FontSrc, + FormAction, + ImgSrc, + ManifestSrc, + MediaSrc, + ObjectSrc, + PluginTypes, + ReportURI, + RequireSRIFor, + Sandbox, + ScriptSrc, + StyleSrc, + TreatAsPublicAddress, + UpgradeInsecureRequests, + WorkerSrc, + }; + static ContentSecurityPolicy* create() { return new ContentSecurityPolicy(); } ~ContentSecurityPolicy(); DECLARE_TRACE(); @@ -311,7 +300,7 @@ // |m_executionContext| (or dropped on the floor if no such context is // available). void reportViolation(const String& directiveText, - const String& effectiveDirective, + const DirectiveType& effectiveType, const String& consoleMessage, const KURL& blockedURL, const Vector<String>& reportEndpoints, @@ -354,8 +343,6 @@ static bool shouldBypassMainWorld(const ExecutionContext*); - static bool isDirectiveName(const String&); - static bool isNonceableElement(const Element*); // This method checks whether the request should be allowed for an @@ -364,6 +351,9 @@ static bool shouldEnforceEmbeddersPolicy(const ResourceResponse&, SecurityOrigin*); + static const char* getDirectiveName(const DirectiveType&); + static DirectiveType getDirectiveType(const String& name); + Document* document() const; private:
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp index b254f6f..66eb624 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
@@ -911,4 +911,51 @@ } } +TEST_F(ContentSecurityPolicyTest, DirectiveType) { + struct TestCase { + ContentSecurityPolicy::DirectiveType type; + const String& name; + } cases[] = { + {ContentSecurityPolicy::DirectiveType::BaseURI, "base-uri"}, + {ContentSecurityPolicy::DirectiveType::BlockAllMixedContent, + "block-all-mixed-content"}, + {ContentSecurityPolicy::DirectiveType::ChildSrc, "child-src"}, + {ContentSecurityPolicy::DirectiveType::ConnectSrc, "connect-src"}, + {ContentSecurityPolicy::DirectiveType::DefaultSrc, "default-src"}, + {ContentSecurityPolicy::DirectiveType::FrameAncestors, "frame-ancestors"}, + {ContentSecurityPolicy::DirectiveType::FrameSrc, "frame-src"}, + {ContentSecurityPolicy::DirectiveType::FontSrc, "font-src"}, + {ContentSecurityPolicy::DirectiveType::FormAction, "form-action"}, + {ContentSecurityPolicy::DirectiveType::ImgSrc, "img-src"}, + {ContentSecurityPolicy::DirectiveType::ManifestSrc, "manifest-src"}, + {ContentSecurityPolicy::DirectiveType::MediaSrc, "media-src"}, + {ContentSecurityPolicy::DirectiveType::ObjectSrc, "object-src"}, + {ContentSecurityPolicy::DirectiveType::PluginTypes, "plugin-types"}, + {ContentSecurityPolicy::DirectiveType::ReportURI, "report-uri"}, + {ContentSecurityPolicy::DirectiveType::RequireSRIFor, "require-sri-for"}, + {ContentSecurityPolicy::DirectiveType::Sandbox, "sandbox"}, + {ContentSecurityPolicy::DirectiveType::ScriptSrc, "script-src"}, + {ContentSecurityPolicy::DirectiveType::StyleSrc, "style-src"}, + {ContentSecurityPolicy::DirectiveType::TreatAsPublicAddress, + "treat-as-public-address"}, + {ContentSecurityPolicy::DirectiveType::UpgradeInsecureRequests, + "upgrade-insecure-requests"}, + {ContentSecurityPolicy::DirectiveType::WorkerSrc, "worker-src"}, + }; + + EXPECT_EQ(ContentSecurityPolicy::DirectiveType::Undefined, + ContentSecurityPolicy::getDirectiveType("random")); + + for (const auto& test : cases) { + const String& nameFromType = + ContentSecurityPolicy::getDirectiveName(test.type); + ContentSecurityPolicy::DirectiveType typeFromName = + ContentSecurityPolicy::getDirectiveType(test.name); + EXPECT_EQ(nameFromType, test.name); + EXPECT_EQ(typeFromName, test.type); + EXPECT_EQ(test.type, ContentSecurityPolicy::getDirectiveType(nameFromType)); + EXPECT_EQ(test.name, ContentSecurityPolicy::getDirectiveName(typeFromName)); + } +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp index 5af409b8..ef1173e 100644 --- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp +++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
@@ -141,7 +141,8 @@ // list itself. if (scheme.isEmpty() && host.isEmpty()) continue; - if (m_policy->isDirectiveName(host)) + if (ContentSecurityPolicy::getDirectiveType(host) != + ContentSecurityPolicy::DirectiveType::Undefined) m_policy->reportDirectiveAsSourceExpression(m_directiveName, host); m_list.append(new CSPSource(m_policy, scheme, host, port, path, hostWildcard, portWildcard));
diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.h b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.h index 282aa6c..56c7070a 100644 --- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.h +++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.h
@@ -53,6 +53,8 @@ FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSourcesSchemes); + FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, GetSourceVector); + FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, OperativeDirectiveGivenType); bool parseSource(const UChar* begin, const UChar* end,
diff --git a/third_party/WebKit/Source/core/html/HTMLDimension.cpp b/third_party/WebKit/Source/core/html/HTMLDimension.cpp index eb50861..21cf532b 100644 --- a/third_party/WebKit/Source/core/html/HTMLDimension.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDimension.cpp
@@ -30,7 +30,9 @@ #include "core/html/HTMLDimension.h" +#include "core/html/parser/HTMLParserIdioms.h" #include "wtf/MathExtras.h" +#include "wtf/text/ParsingUtilities.h" #include "wtf/text/StringToNumber.h" #include "wtf/text/WTFString.h" @@ -146,4 +148,53 @@ return parsedDimensions; } +template <typename CharacterType> +static bool parseDimensionValue(const CharacterType* current, + const CharacterType* end, + HTMLDimension& dimension) { + skipWhile<CharacterType, isHTMLSpace>(current, end); + // Deviation: HTML allows '+' here. + const CharacterType* numberStart = current; + if (!skipExactly<CharacterType, isASCIIDigit>(current, end)) + return false; + skipWhile<CharacterType, isASCIIDigit>(current, end); + if (skipExactly<CharacterType>(current, end, '.')) { + // Deviation: HTML requires a digit after the full stop to be able to treat + // the value as a percentage (if not, the '.' will considered "garbage", + // yielding a regular length.) Gecko and Edge does not. + skipWhile<CharacterType, isASCIIDigit>(current, end); + } + bool ok; + double value = charactersToDouble(numberStart, current - numberStart, &ok); + if (!ok) + return false; + HTMLDimension::HTMLDimensionType type = HTMLDimension::Absolute; + if (current < end) { + if (*current == '%') { + type = HTMLDimension::Percentage; + } else if (*current == '*') { + // Deviation: HTML does not recognize '*' in this context, and we don't + // treat it as a valid value. We do count it though, so this is purely + // for statistics. Note though that per the specced behavior, "<number>*" + // would be the same as "<number>" (i.e '*' would just be trailing + // garbage.) + type = HTMLDimension::Relative; + } + } + dimension = HTMLDimension(value, type); + return true; +} + +// https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-dimension-values +bool parseDimensionValue(const String& input, HTMLDimension& dimension) { + if (input.isEmpty()) + return false; + if (input.is8Bit()) { + return parseDimensionValue(input.characters8(), + input.characters8() + input.length(), dimension); + } + return parseDimensionValue(input.characters16(), + input.characters16() + input.length(), dimension); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLDimension.h b/third_party/WebKit/Source/core/html/HTMLDimension.h index aa2e7f1..b10bebfc 100644 --- a/third_party/WebKit/Source/core/html/HTMLDimension.h +++ b/third_party/WebKit/Source/core/html/HTMLDimension.h
@@ -72,6 +72,7 @@ }; CORE_EXPORT Vector<HTMLDimension> parseListOfDimensions(const String&); +CORE_EXPORT bool parseDimensionValue(const String&, HTMLDimension&); } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLDimensionTest.cpp b/third_party/WebKit/Source/core/html/HTMLDimensionTest.cpp index 8383e91..de55fbf 100644 --- a/third_party/WebKit/Source/core/html/HTMLDimensionTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDimensionTest.cpp
@@ -198,4 +198,78 @@ ASSERT_EQ(HTMLDimension(8., HTMLDimension::Percentage), result[2]); } +TEST(HTMLDimensionTest, parseDimensionValueEmptyString) { + HTMLDimension dimension; + EXPECT_FALSE(parseDimensionValue(String(""), dimension)); +} + +TEST(HTMLDimensionTest, parseDimensionValueSpacesOnly) { + HTMLDimension dimension; + EXPECT_FALSE(parseDimensionValue(String(" "), dimension)); +} + +TEST(HTMLDimensionTest, parseDimensionValueAllowedSpaces) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String(" \t\f\r\n10"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Absolute), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValueLeadingPlus) { + HTMLDimension dimension; + EXPECT_FALSE(parseDimensionValue(String("+10"), dimension)); +} + +TEST(HTMLDimensionTest, parseDimensionValueAbsolute) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Absolute), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValueAbsoluteFraction) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10.50"), dimension)); + EXPECT_EQ(HTMLDimension(10.5, HTMLDimension::Absolute), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValueAbsoluteDotNoFraction) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10.%"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Percentage), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValueAbsoluteTrailingGarbage) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10foo"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Absolute), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValueAbsoluteTrailingGarbageAfterSpace) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10 foo"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Absolute), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValuePercentage) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10%"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Percentage), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValueRelative) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10*"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Relative), dimension); +} + +TEST(HTMLDimensionTest, parseDimensionValueInvalidNumberFormatDot) { + HTMLDimension dimension; + EXPECT_FALSE(parseDimensionValue(String(".50"), dimension)); +} + +TEST(HTMLDimensionTest, parseDimensionValueInvalidNumberFormatExponent) { + HTMLDimension dimension; + EXPECT_TRUE(parseDimensionValue(String("10e10"), dimension)); + EXPECT_EQ(HTMLDimension(10, HTMLDimension::Absolute), dimension); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp index 186767c..dc111ef 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -51,6 +51,7 @@ #include "core/frame/Settings.h" #include "core/frame/UseCounter.h" #include "core/html/HTMLBRElement.h" +#include "core/html/HTMLDimension.h" #include "core/html/HTMLFormElement.h" #include "core/html/HTMLInputElement.h" #include "core/html/HTMLMenuElement.h" @@ -902,43 +903,24 @@ void HTMLElement::addHTMLLengthToStyle(MutableStylePropertySet* style, CSSPropertyID propertyID, - const String& value) { - // FIXME: This function should not spin up the CSS parser, but should instead - // just figure out the correct length unit and make the appropriate parsed - // value. - - // strip attribute garbage.. - StringImpl* v = value.impl(); - if (v) { - unsigned length = 0; - - while (length < v->length() && (*v)[length] <= ' ') - length++; - - for (; length < v->length(); length++) { - UChar cc = (*v)[length]; - if (cc > '9') - break; - if (cc < '0') { - if (cc == '%' || cc == '*') { - if (propertyID == CSSPropertyWidth) - UseCounter::count(document(), - UseCounter::HTMLElementDeprecatedWidth); - length++; - } - if (cc != '.') - break; - } - } - - if (length != v->length()) { - addPropertyToPresentationAttributeStyle(style, propertyID, - v->substring(0, length)); - return; - } + const String& value, + AllowPercentage allowPercentage) { + HTMLDimension dimension; + if (!parseDimensionValue(value, dimension)) + return; + if (propertyID == CSSPropertyWidth && + (dimension.isPercentage() || dimension.isRelative())) { + UseCounter::count(document(), UseCounter::HTMLElementDeprecatedWidth); } - - addPropertyToPresentationAttributeStyle(style, propertyID, value); + if (dimension.isRelative()) + return; + if (dimension.isPercentage() && allowPercentage != AllowPercentageValues) + return; + CSSPrimitiveValue::UnitType unit = + dimension.isPercentage() ? CSSPrimitiveValue::UnitType::Percentage + : CSSPrimitiveValue::UnitType::Pixels; + addPropertyToPresentationAttributeStyle(style, propertyID, dimension.value(), + unit); } static RGBA32 parseColorStringWithCrazyLegacyRules(const String& colorString) {
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.h b/third_party/WebKit/Source/core/html/HTMLElement.h index 6a33cd0..9ad60ed 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.h +++ b/third_party/WebKit/Source/core/html/HTMLElement.h
@@ -122,9 +122,11 @@ protected: HTMLElement(const QualifiedName& tagName, Document&, ConstructionType); + enum AllowPercentage { DontAllowPercentageValues, AllowPercentageValues }; void addHTMLLengthToStyle(MutableStylePropertySet*, CSSPropertyID, - const String& value); + const String& value, + AllowPercentage = AllowPercentageValues); void addHTMLColorToStyle(MutableStylePropertySet*, CSSPropertyID, const String& color);
diff --git a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp index 23cfa78..a3fdf43 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp
@@ -328,8 +328,10 @@ addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, value); } else if (name == cellspacingAttr) { - if (!value.isEmpty()) - addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value); + if (!value.isEmpty()) { + addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value, + DontAllowPercentageValues); + } } else if (name == alignAttr) { if (!value.isEmpty()) { if (equalIgnoringCase(value, "center")) {
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp index 5f190e3..9650421 100644 --- a/third_party/WebKit/Source/core/input/EventHandler.cpp +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -1172,10 +1172,8 @@ Node* newNodeUnderMouse = targetNode; // If we're capturing, we always go right to that node. - EventTarget* mousePointerCapturingNode = - m_pointerEventManager->getMouseCapturingNode(); - if (mousePointerCapturingNode && - !RuntimeEnabledFeatures::pointerEventV1SpecCapturingEnabled()) { + if (EventTarget* mousePointerCapturingNode = + m_pointerEventManager->getMouseCapturingNode()) { newNodeUnderMouse = mousePointerCapturingNode->toNode(); DCHECK(newNodeUnderMouse); } else if (m_capturingMouseEventsNode) {
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp index de73cdadc..9c2e4d51 100644 --- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp +++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -209,19 +209,6 @@ void PointerEventManager::sendBoundaryEvents(EventTarget* exitedTarget, EventTarget* enteredTarget, PointerEvent* pointerEvent) { - if (RuntimeEnabledFeatures::pointerEventV1SpecCapturingEnabled()) { - if (exitedTarget == enteredTarget) - return; - if (EventTarget* capturingTarget = - getCapturingNode(pointerEvent->pointerId())) { - if (capturingTarget == exitedTarget) - enteredTarget = nullptr; - else if (capturingTarget == enteredTarget) - exitedTarget = nullptr; - else - return; - } - } PointerEventBoundaryEventDispatcher boundaryEventDispatcher(this, pointerEvent); boundaryEventDispatcher.sendBoundaryEvents(exitedTarget, enteredTarget); @@ -344,8 +331,7 @@ // that will be capturing this event. |m_pointerCaptureTarget| may not // have this target yet since the processing of that will be done right // before firing the event. - if (RuntimeEnabledFeatures::pointerEventV1SpecCapturingEnabled() || - touchInfo.point.state() == PlatformTouchPoint::TouchPressed || + if (touchInfo.point.state() == PlatformTouchPoint::TouchPressed || !m_pendingPointerCaptureTarget.contains(pointerId)) { HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | HitTestRequest::ReadOnly | @@ -438,8 +424,7 @@ processCaptureAndPositionOfPointerEvent(pointerEvent, target); // Setting the implicit capture for touch - if (!RuntimeEnabledFeatures::pointerEventV1SpecCapturingEnabled() && - pointerEvent->type() == EventTypeNames::pointerdown) + if (pointerEvent->type() == EventTypeNames::pointerdown) setPointerCapture(pointerEvent->pointerId(), target); WebInputEventResult result = dispatchPointerEvent( @@ -558,13 +543,11 @@ bool sendMouseEvent) { processPendingPointerCapture(pointerEvent); - if (!RuntimeEnabledFeatures::pointerEventV1SpecCapturingEnabled()) { - PointerCapturingMap::const_iterator it = - m_pointerCaptureTarget.find(pointerEvent->pointerId()); - if (EventTarget* pointercaptureTarget = - (it != m_pointerCaptureTarget.end()) ? it->value : nullptr) - hitTestTarget = pointercaptureTarget; - } + PointerCapturingMap::const_iterator it = + m_pointerCaptureTarget.find(pointerEvent->pointerId()); + if (EventTarget* pointercaptureTarget = + (it != m_pointerCaptureTarget.end()) ? it->value : nullptr) + hitTestTarget = pointercaptureTarget; setNodeUnderPointer(pointerEvent, hitTestTarget); if (sendMouseEvent) {
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp index 9756454..6573772 100644 --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -63,9 +63,7 @@ } } -void LayoutGrid::Grid::insert(LayoutBox& child, - const GridArea& area, - bool isOrthogonalChild) { +void LayoutGrid::Grid::insert(LayoutBox& child, const GridArea& area) { DCHECK(area.rows.isTranslatedDefinite() && area.columns.isTranslatedDefinite()); ensureGridSize(area.rows.endLine(), area.columns.endLine()); @@ -76,8 +74,6 @@ } setGridItemArea(child, area); - - m_hasAnyOrthogonalChildren = m_hasAnyOrthogonalChildren || isOrthogonalChild; } void LayoutGrid::Grid::setSmallestTracksStart(int rowStart, int columnStart) { @@ -162,11 +158,16 @@ return direction == ForColumns ? area.columns : area.rows; } +void LayoutGrid::Grid::setHasAnyOrthogonalGridItem( + bool hasAnyOrthogonalGridItem) { + m_hasAnyOrthogonalGridItem = hasAnyOrthogonalGridItem; +} + void LayoutGrid::Grid::clear() { m_grid.resize(0); m_gridItemArea.clear(); m_gridItemsIndexesMap.clear(); - m_hasAnyOrthogonalChildren = false; + m_hasAnyOrthogonalGridItem = false; m_smallestRowStart = 0; m_smallestColumnStart = 0; m_autoRepeatColumns = 0; @@ -577,7 +578,7 @@ // all the cases with orthogonal flows require this extra cycle; we need a // more specific condition to detect whether child's min-content contribution // has changed or not. - if (m_grid.hasAnyOrthogonalChildren()) { + if (m_grid.hasAnyOrthogonalGridItem()) { computeTrackSizesForDefiniteSize(ForColumns, sizingData, availableSpaceForColumns); computeTrackSizesForDefiniteSize(ForRows, sizingData, @@ -956,7 +957,7 @@ tracks[trackIndex], gridTrackSize(direction, trackIndex).maxTrackBreadth().flex())); - if (m_grid.hasInFlowGridItems()) { + if (m_grid.hasGridItems()) { for (size_t i = 0; i < flexibleSizedTracksIndex.size(); ++i) { GridIterator iterator(m_grid, direction, flexibleSizedTracksIndex[i]); while (LayoutBox* gridItem = iterator.nextGridItem()) { @@ -1484,7 +1485,7 @@ GridTrackSizingDirection direction, GridSizingData& sizingData) const { sizingData.itemsSortedByIncreasingSpan.shrink(0); - if (m_grid.hasInFlowGridItems()) { + if (m_grid.hasGridItems()) { HashSet<LayoutBox*> itemsSet; for (const auto& trackIndex : sizingData.contentSizedTracksIndex) { GridIterator iterator(m_grid, direction, trackIndex); @@ -2023,7 +2024,7 @@ size_t lastAutoRepeatTrack = firstAutoRepeatTrack + autoRepeatCountForDirection(direction); - if (!m_grid.hasInFlowGridItems()) { + if (!m_grid.hasGridItems()) { emptyTrackIndexes = wrapUnique(new OrderedTrackIndexSet); for (size_t trackIndex = firstAutoRepeatTrack; trackIndex < lastAutoRepeatTrack; ++trackIndex) @@ -2046,7 +2047,7 @@ if (!m_gridIsDirty) return; - DCHECK(!m_grid.hasInFlowGridItems()); + DCHECK(!m_grid.hasGridItems()); size_t autoRepeatColumns; size_t autoRepeatRows = @@ -2063,19 +2064,22 @@ // We clear the dirty bit here as the grid sizes have been updated. m_gridIsDirty = false; + bool hasAnyOrthogonalGridItem = false; Vector<LayoutBox*> autoMajorAxisAutoGridItems; Vector<LayoutBox*> specifiedMajorAxisAutoGridItems; #if ENABLE(ASSERT) DCHECK(!m_grid.hasAnyGridItemPaintOrder()); #endif - DCHECK(!m_grid.hasAnyOrthogonalChildren()); + DCHECK(!m_grid.hasAnyOrthogonalGridItem()); size_t childIndex = 0; for (LayoutBox* child = m_grid.orderIterator().first(); child; child = m_grid.orderIterator().next()) { if (child->isOutOfFlowPositioned()) continue; + hasAnyOrthogonalGridItem = + hasAnyOrthogonalGridItem || isOrthogonalChild(*child); m_grid.setGridItemPaintOrder(*child, childIndex++); GridArea area = m_grid.gridItemArea(*child); @@ -2095,11 +2099,12 @@ specifiedMajorAxisAutoGridItems.append(child); continue; } - m_grid.insert(*child, area, isOrthogonalChild(*child)); + m_grid.insert(*child, area); } + m_grid.setHasAnyOrthogonalGridItem(hasAnyOrthogonalGridItem); #if ENABLE(ASSERT) - if (m_grid.hasInFlowGridItems()) { + if (m_grid.hasGridItems()) { DCHECK_GE(m_grid.numTracks(ForRows), GridPositionsResolver::explicitGridRowCount( *style(), m_grid.autoRepeatTracks(ForRows))); @@ -2245,8 +2250,7 @@ emptyGridArea = createEmptyGridAreaAtSpecifiedPositionsOutsideGrid( *autoGridItem, autoPlacementMajorAxisDirection(), majorAxisPositions); - m_grid.insert(*autoGridItem, *emptyGridArea, - isOrthogonalChild(*autoGridItem)); + m_grid.insert(*autoGridItem, *emptyGridArea); if (!isGridAutoFlowDense) minorAxisCursors.set(majorAxisInitialPosition, @@ -2351,7 +2355,7 @@ GridSpan::translatedDefiniteGridSpan(0, minorAxisSpanSize)); } - m_grid.insert(gridItem, *emptyGridArea, isOrthogonalChild(gridItem)); + m_grid.insert(gridItem, *emptyGridArea); // Move auto-placement cursor to the new position. autoPlacementCursor.first = emptyGridArea->rows.startLine(); autoPlacementCursor.second = emptyGridArea->columns.startLine(); @@ -3064,7 +3068,7 @@ } int LayoutGrid::firstLineBoxBaseline() const { - if (isWritingModeRoot() || !m_grid.hasInFlowGridItems()) + if (isWritingModeRoot() || !m_grid.hasGridItems()) return -1; const LayoutBox* baselineChild = nullptr; const LayoutBox* firstChild = nullptr; @@ -3549,7 +3553,7 @@ void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const { - if (m_grid.hasInFlowGridItems()) + if (m_grid.hasGridItems()) GridPainter(*this).paintChildren(paintInfo, paintOffset); }
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.h b/third_party/WebKit/Source/core/layout/LayoutGrid.h index 3fe38083..5c8f626 100644 --- a/third_party/WebKit/Source/core/layout/LayoutGrid.h +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.h
@@ -345,10 +345,15 @@ size_t numTracks(GridTrackSizingDirection) const; void ensureGridSize(size_t maximumRowSize, size_t maximumColumnSize); - void insert(LayoutBox&, const GridArea&, bool isOrthogonalChild); + void insert(LayoutBox&, const GridArea&); - bool hasInFlowGridItems() const { return !m_gridItemArea.isEmpty(); } - bool hasAnyOrthogonalChildren() const { return m_hasAnyOrthogonalChildren; } + // Note that out of flow children are not grid items. + bool hasGridItems() const { return !m_gridItemArea.isEmpty(); } + + // TODO(svillar): move this to SizingData once it's passed to + // placeItemsOnGrid. + bool hasAnyOrthogonalGridItem() const { return m_hasAnyOrthogonalGridItem; } + void setHasAnyOrthogonalGridItem(bool); GridArea gridItemArea(const LayoutBox& item) const; void setGridItemArea(const LayoutBox& item, GridArea); @@ -397,7 +402,7 @@ size_t m_autoRepeatColumns{0}; size_t m_autoRepeatRows{0}; - bool m_hasAnyOrthogonalChildren{false}; + bool m_hasAnyOrthogonalGridItem{false}; GridAsMatrix m_grid; HashMap<const LayoutBox*, GridArea> m_gridItemArea;
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp index f211a98..7401cbaa5 100644 --- a/third_party/WebKit/Source/core/layout/LayoutView.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -817,6 +817,7 @@ } void LayoutView::commitPendingSelection() { + TRACE_EVENT0("blink", "LayoutView::commitPendingSelection"); m_frameView->frame().selection().commitAppearanceIfNeeded(*this); }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc b/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc index 58337c5..48b234f 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc
@@ -5,6 +5,7 @@ #include "core/layout/ng/ng_bidi_paragraph.h" #include "core/style/ComputedStyle.h" +#include "platform/text/ICUError.h" namespace blink { @@ -16,13 +17,19 @@ const ComputedStyle* block_style) { DCHECK(!ubidi_); ubidi_ = ubidi_open(); - UErrorCode error = U_ZERO_ERROR; + ICUError error; ubidi_setPara(ubidi_, text.characters16(), text.length(), block_style->unicodeBidi() == Plaintext ? UBIDI_DEFAULT_LTR : (block_style->direction() == RTL ? UBIDI_RTL : UBIDI_LTR), nullptr, &error); - return U_SUCCESS(error); + if (U_FAILURE(error)) { + NOTREACHED(); + ubidi_close(ubidi_); + ubidi_ = nullptr; + return false; + } + return true; } unsigned NGBidiParagraph::GetLogicalRun(unsigned start,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc index 481d4bd..72e5ed6 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
@@ -119,7 +119,6 @@ text_content_.ensure16Bit(); if (!bidi.SetParagraph(text_content_, block_style_.get())) { // On failure, give up bidi resolving and reordering. - NOTREACHED(); is_bidi_enabled_ = false; return; }
diff --git a/third_party/WebKit/Source/core/loader/PingLoader.cpp b/third_party/WebKit/Source/core/loader/PingLoader.cpp index a08a69e..693c264b 100644 --- a/third_party/WebKit/Source/core/loader/PingLoader.cpp +++ b/third_party/WebKit/Source/core/loader/PingLoader.cpp
@@ -210,9 +210,9 @@ WebURLRequest&, const WebURLResponse&) override; void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; - void didReceiveData(WebURLLoader*, const char*, int, int, int) final; - void didFinishLoading(WebURLLoader*, double, int64_t) final; - void didFail(WebURLLoader*, const WebURLError&, int64_t) final; + void didReceiveData(WebURLLoader*, const char*, int, int) final; + void didFinishLoading(WebURLLoader*, double, int64_t, int64_t) final; + void didFail(WebURLLoader*, const WebURLError&, int64_t, int64_t) final; void timeout(TimerBase*); @@ -346,7 +346,7 @@ dispose(); } -void PingLoaderImpl::didReceiveData(WebURLLoader*, const char*, int, int, int) { +void PingLoaderImpl::didReceiveData(WebURLLoader*, const char*, int, int) { if (LocalFrame* frame = this->frame()) { TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", InspectorResourceFinishEvent::data(m_identifier, 0, true)); @@ -355,7 +355,7 @@ dispose(); } -void PingLoaderImpl::didFinishLoading(WebURLLoader*, double, int64_t) { +void PingLoaderImpl::didFinishLoading(WebURLLoader*, double, int64_t, int64_t) { if (LocalFrame* frame = this->frame()) { TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", InspectorResourceFinishEvent::data(m_identifier, 0, true)); @@ -366,6 +366,7 @@ void PingLoaderImpl::didFail(WebURLLoader*, const WebURLError& resourceError, + int64_t, int64_t) { if (LocalFrame* frame = this->frame()) { TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp index c685d64..7509d86 100644 --- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp +++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -243,7 +243,7 @@ DEFINE_TRACE(OffscreenCanvas) { visitor->trace(m_context); visitor->trace(m_executionContext); - EventTarget::trace(visitor); + EventTargetWithInlineData::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index 456697c..b9fbf336 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -784,7 +784,7 @@ setHasVerticalScrollbar(false); } - clampScrollOffsetsAfterLayout(); + clampScrollOffsetAfterOverflowChange(); if (!scrollbarsAreFrozen) { updateScrollableAreaSet(hasScrollableHorizontalOverflow() || @@ -795,7 +795,7 @@ positionOverflowControls(); } -void PaintLayerScrollableArea::clampScrollOffsetsAfterLayout() { +void PaintLayerScrollableArea::clampScrollOffsetAfterOverflowChange() { // If a vertical scrollbar was removed, the min/max scroll offsets may have // changed, so the scroll offsets needs to be clamped. If the scroll offset // did not change, but the scroll origin *did* change, we still need to notify @@ -999,6 +999,8 @@ box().setNeedsLayoutAndFullPaintInvalidation( LayoutInvalidationReason::Unknown); } + + clampScrollOffsetAfterOverflowChange(); } IntRect PaintLayerScrollableArea::rectForHorizontalScrollbar( @@ -2015,7 +2017,7 @@ void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: clampScrollableAreas() { for (auto& scrollableArea : *s_needsClamp) - scrollableArea->clampScrollOffsetsAfterLayout(); + scrollableArea->clampScrollOffsetAfterOverflowChange(); delete s_needsClamp; s_needsClamp = nullptr; }
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h index fcd322074f..0d5aeb28 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
@@ -320,7 +320,7 @@ // Currently, they run at the end of box()'es layout (or after all flexbox // layout has finished) but while document layout is still happening. void updateAfterLayout(); - void clampScrollOffsetsAfterLayout(); + void clampScrollOffsetAfterOverflowChange(); void didChangeGlobalRootScroller() override;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp index 617e4aa..eef1ab9 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -67,6 +67,7 @@ #include "core/layout/LayoutListMarker.h" #include "core/layout/LayoutMenuList.h" #include "core/layout/LayoutTextControl.h" +#include "core/layout/LayoutTextFragment.h" #include "core/layout/LayoutView.h" #include "core/layout/api/LayoutAPIShim.h" #include "core/layout/api/LayoutViewItem.h" @@ -126,6 +127,13 @@ LayoutObject* layoutObject) { LayoutObject* firstChild = layoutObject->slowFirstChild(); + // CSS first-letter pseudo element is handled as continuation. Returning it + // will result in duplicated elements. + if (firstChild && firstChild->isText() && + toLayoutText(firstChild)->isTextFragment() && + toLayoutTextFragment(firstChild)->firstLetterPseudoElement()) + return nullptr; + if (!firstChild && isInlineWithContinuation(layoutObject)) firstChild = firstChildInContinuation(toLayoutInline(*layoutObject));
diff --git a/third_party/WebKit/Source/modules/imagecapture/BUILD.gn b/third_party/WebKit/Source/modules/imagecapture/BUILD.gn index dfed63f..92625497 100644 --- a/third_party/WebKit/Source/modules/imagecapture/BUILD.gn +++ b/third_party/WebKit/Source/modules/imagecapture/BUILD.gn
@@ -14,6 +14,6 @@ ] deps = [ - "//media/mojo/interfaces:image_capture_blink", + "//media/capture/mojo:image_capture_blink", ] }
diff --git a/third_party/WebKit/Source/modules/imagecapture/DEPS b/third_party/WebKit/Source/modules/imagecapture/DEPS index 055e227..f874cfc 100644 --- a/third_party/WebKit/Source/modules/imagecapture/DEPS +++ b/third_party/WebKit/Source/modules/imagecapture/DEPS
@@ -1,3 +1,3 @@ include_rules = [ - "+media/mojo/interfaces/image_capture.mojom-blink.h", + "+media/capture/mojo/image_capture.mojom-blink.h", ]
diff --git a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h index 6ef3fa7..c3d68c2 100644 --- a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h +++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
@@ -9,7 +9,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "core/dom/ContextLifecycleObserver.h" #include "core/events/EventTarget.h" -#include "media/mojo/interfaces/image_capture.mojom-blink.h" +#include "media/capture/mojo/image_capture.mojom-blink.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" #include "platform/AsyncMethodRunner.h"
diff --git a/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.h b/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.h index 9f9d739..45a9ac1 100644 --- a/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.h +++ b/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.h
@@ -6,7 +6,7 @@ #define PhotoCapabilities_h #include "bindings/core/v8/ScriptWrappable.h" -#include "media/mojo/interfaces/image_capture.mojom-blink.h" +#include "media/capture/mojo/image_capture.mojom-blink.h" #include "modules/imagecapture/MediaSettingsRange.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/modules/payments/PaymentDetails.idl b/third_party/WebKit/Source/modules/payments/PaymentDetails.idl index 1c52f9f..0bcabdd 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentDetails.idl +++ b/third_party/WebKit/Source/modules/payments/PaymentDetails.idl
@@ -9,5 +9,5 @@ sequence<PaymentItem> displayItems; sequence<PaymentShippingOption> shippingOptions; sequence<PaymentDetailsModifier> modifiers; - DOMString error; + [RuntimeEnabled=PaymentDetailsError] DOMString error; };
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn index 264b1a4..b562a1cf 100644 --- a/third_party/WebKit/Source/platform/BUILD.gn +++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -1297,6 +1297,8 @@ "text/DecodeEscapeSequences.h", "text/Hyphenation.cpp", "text/Hyphenation.h", + "text/ICUError.cpp", + "text/ICUError.h", "text/LineEnding.cpp", "text/LineEnding.h", "text/LocaleICU.cpp",
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in index 9b014b4..750ce512 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
@@ -171,6 +171,7 @@ PassiveEventListenersDueToFling status=experimental PassPaintVisualRectToCompositor PaymentApp status=experimental +PaymentDetailsError status=experimental // PaymentRequest is enabled by default on Android PaymentRequest status=experimental PaymentRequestIFrame status=experimental @@ -180,8 +181,6 @@ Permissions status=stable PermissionsRequestRevoke status=experimental PointerEvent status=stable -// For temporary compat testing of Edge-like model - crbug.com/640700 -PointerEventV1SpecCapturing PreciseMemoryInfo PreferredImageRasterBounds settable_from_internals=True // This feature is deprecated and we are evangelizing affected sites. @@ -250,7 +249,7 @@ WebUSB status=experimental, origin_trial_feature_name=WebUSB WebVR origin_trial_feature_name=WebVR WebVTTRegions status=experimental -V8BasedStructuredClone +V8BasedStructuredClone status=stable V8IdleTasks VisibilityChangeOnUnload status=stable XSLT status=stable
diff --git a/third_party/WebKit/Source/platform/exported/WebURLLoaderTestDelegate.cpp b/third_party/WebKit/Source/platform/exported/WebURLLoaderTestDelegate.cpp index 59b373d..072bbbf8 100644 --- a/third_party/WebKit/Source/platform/exported/WebURLLoaderTestDelegate.cpp +++ b/third_party/WebKit/Source/platform/exported/WebURLLoaderTestDelegate.cpp
@@ -28,23 +28,26 @@ const char* data, int dataLength, int encodedDataLength) { - originalClient->didReceiveData(loader, data, dataLength, encodedDataLength, - dataLength); + originalClient->didReceiveData(loader, data, dataLength, encodedDataLength); } void WebURLLoaderTestDelegate::didFail(WebURLLoaderClient* originalClient, WebURLLoader* loader, const WebURLError& error, - int64_t totalEncodedDataLength) { - originalClient->didFail(loader, error, totalEncodedDataLength); + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) { + originalClient->didFail(loader, error, totalEncodedDataLength, + totalEncodedBodyLength); } void WebURLLoaderTestDelegate::didFinishLoading( WebURLLoaderClient* originalClient, WebURLLoader* loader, double finishTime, - int64_t totalEncodedDataLength) { - originalClient->didFinishLoading(loader, finishTime, totalEncodedDataLength); + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) { + originalClient->didFinishLoading(loader, finishTime, totalEncodedDataLength, + totalEncodedBodyLength); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp index 9b3283cb..0f9fa07f 100644 --- a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp +++ b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp
@@ -99,8 +99,7 @@ if (m_fallbackStage == SystemFonts) { // We've reached pref + system fallback. - ASSERT(hintList.size()); - RefPtr<SimpleFontData> systemFont = uniqueSystemFontForHint(hintList[0]); + RefPtr<SimpleFontData> systemFont = uniqueSystemFontForHintList(hintList); if (systemFont) { // Fallback fonts are not retained in the FontDataCache. return uniqueOrNext(adoptRef(new FontDataForRangeSet(systemFont)), @@ -193,15 +192,47 @@ m_fontFallbackPriority); } -PassRefPtr<SimpleFontData> FontFallbackIterator::uniqueSystemFontForHint( - UChar32 hint) { +static inline unsigned chooseHintIndex(const Vector<UChar32>& hintList) { + // crbug.com/618178 has a test case where no Myanmar font is ever found, + // because the run starts with a punctuation character with a script value of + // common. Our current font fallback code does not find a very meaningful + // result for this. + // TODO crbug.com/668706 - Improve this situation. + // So if we have multiple hint characters (which indicates that a + // multi-character grapheme or more failed to shape, then we can try to be + // smarter and select the first character that has an actual script value. + DCHECK(hintList.size()); + if (hintList.size() <= 1) + return 0; + + UErrorCode err = U_ZERO_ERROR; + UScriptCode hintCharScript = uscript_getScript(hintList[0], &err); + if (!U_SUCCESS(err) || hintCharScript > USCRIPT_INHERITED) + return 0; + + for (size_t i = 1; i < hintList.size(); ++i) { + UScriptCode newHintScript = uscript_getScript(hintList[i], &err); + if (!U_SUCCESS(err)) + return 0; + if (newHintScript > USCRIPT_INHERITED) + return i; + } + return 0; +} + +PassRefPtr<SimpleFontData> FontFallbackIterator::uniqueSystemFontForHintList( + const Vector<UChar32>& hintList) { // When we're asked for a fallback for the same characters again, we give up // because the shaper must have previously tried shaping with the font // already. - if (!hint || m_previouslyAskedForHint.contains(hint)) + if (!hintList.size()) return nullptr; FontCache* fontCache = FontCache::fontCache(); + UChar32 hint = hintList[chooseHintIndex(hintList)]; + + if (!hint || m_previouslyAskedForHint.contains(hint)) + return nullptr; m_previouslyAskedForHint.add(hint); return fontCache->fallbackFontForCharacter( m_fontDescription, hint,
diff --git a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h index 9a3f0dd..4b8f30cc 100644 --- a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h +++ b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h
@@ -51,7 +51,8 @@ const Vector<UChar32>& hintList); PassRefPtr<SimpleFontData> fallbackPriorityFont(UChar32 hint); - PassRefPtr<SimpleFontData> uniqueSystemFontForHint(UChar32 hint); + PassRefPtr<SimpleFontData> uniqueSystemFontForHintList( + const Vector<UChar32>& hintList); const FontDescription& m_fontDescription; RefPtr<FontFallbackList> m_fontFallbackList;
diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc index 8f74d52..abbb94e 100644 --- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc +++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
@@ -49,7 +49,7 @@ return; if (error.reason) { - delegate->didFail(client_, this, error, data.size()); + delegate->didFail(client_, this, error, data.size(), 0); return; } delegate->didReceiveData(client_, this, data.data(), data.size(), @@ -57,7 +57,7 @@ if (!self) return; - delegate->didFinishLoading(client_, this, 0, data.size()); + delegate->didFinishLoading(client_, this, 0, data.size(), data.size()); } WebURLRequest WebURLLoaderMock::ServeRedirect( @@ -99,7 +99,8 @@ WebURLResponse& response, WebURLError& error, WebData& data, - int64_t& encoded_data_length) { + int64_t& encoded_data_length, + int64_t& encoded_body_length) { if (factory_->IsMockedURL(request.url())) { factory_->LoadSynchronously(request, &response, &error, &data, &encoded_data_length); @@ -110,7 +111,7 @@ << request.url().string().utf8(); using_default_loader_ = true; default_loader_->loadSynchronously(request, response, error, data, - encoded_data_length); + encoded_data_length, encoded_body_length); } void WebURLLoaderMock::loadAsynchronously(const WebURLRequest& request,
diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h index 13e5141a..2a9536f 100644 --- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h +++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h
@@ -48,7 +48,8 @@ WebURLResponse& response, WebURLError& error, WebData& data, - int64_t& encoded_data_length) override; + int64_t& encoded_data_length, + int64_t& encoded_body_length) override; void loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client) override; void cancel() override;
diff --git a/third_party/WebKit/Source/platform/text/ICUError.cpp b/third_party/WebKit/Source/platform/text/ICUError.cpp new file mode 100644 index 0000000..33d64313 --- /dev/null +++ b/third_party/WebKit/Source/platform/text/ICUError.cpp
@@ -0,0 +1,28 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "platform/text/ICUError.h" + +namespace blink { + +// Distinguish memory allocation failures from other errors. +// https://groups.google.com/a/chromium.org/d/msg/platform-architecture-dev/MP0k9WGnCjA/zIBiJtilBwAJ +static NEVER_INLINE void ICUOutOfMemory() { + OOM_CRASH(); +} + +void ICUError::handleFailure() { + switch (m_error) { + case U_MEMORY_ALLOCATION_ERROR: + ICUOutOfMemory(); + break; + case U_ILLEGAL_ARGUMENT_ERROR: + CHECK(false) << m_error; + break; + default: + break; + } +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/platform/text/ICUError.h b/third_party/WebKit/Source/platform/text/ICUError.h new file mode 100644 index 0000000..ad6725cf --- /dev/null +++ b/third_party/WebKit/Source/platform/text/ICUError.h
@@ -0,0 +1,41 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ICUError_h +#define ICUError_h + +#include "platform/PlatformExport.h" +#include "wtf/Allocator.h" +#include "wtf/Assertions.h" +#include <unicode/utypes.h> + +namespace blink { + +// ICUError provides the unified way to handle ICU errors in Blink. +class PLATFORM_EXPORT ICUError { + STACK_ALLOCATED(); + + public: + ~ICUError() { crashIfCritical(); } + + UErrorCode* operator&() { return &m_error; } + operator UErrorCode() const { return m_error; } + + // Crash the renderer in the appropriate way if critical failure occurred. + void crashIfCritical(); + + private: + UErrorCode m_error = U_ZERO_ERROR; + + void handleFailure(); +}; + +inline void ICUError::crashIfCritical() { + if (U_FAILURE(m_error)) + handleFailure(); +} + +} // namespace blink + +#endif // ICUError_h
diff --git a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp index 7d8c21a..c3e799ab 100644 --- a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp +++ b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
@@ -218,10 +218,6 @@ RuntimeEnabledFeatures::setPointerEventEnabled(enable); } -void WebRuntimeFeatures::enablePointerEventV1SpecCapturing(bool enable) { - RuntimeEnabledFeatures::setPointerEventV1SpecCapturingEnabled(enable); -} - void WebRuntimeFeatures::enableScriptedSpeech(bool enable) { RuntimeEnabledFeatures::setScriptedSpeechEnabled(enable); }
diff --git a/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp b/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp index d76a4d9..7a9a4ba2 100644 --- a/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp +++ b/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp
@@ -50,7 +50,7 @@ int encodedDataLength) override { EXPECT_EQ(34, dataLength) << "foo.html was not served in a single chunk"; originalClient->didReceiveData(loader, data, dataLength, - encodedDataLength, dataLength); + encodedDataLength); } } delegate; @@ -76,7 +76,7 @@ EXPECT_EQ(34, dataLength) << "foo.html was not served in a single chunk"; // Chunk the reply into one byte chunks. for (int i = 0; i < dataLength; ++i) - originalClient->didReceiveData(loader, &data[i], 1, 1, 1); + originalClient->didReceiveData(loader, &data[i], 1, 1); } } delegate; @@ -147,7 +147,7 @@ void dispatchOneByte() { char c = m_data.front(); m_data.pop(); - m_loaderClient->didReceiveData(m_loader, &c, 1, 1, 1); + m_loaderClient->didReceiveData(m_loader, &c, 1, 1); } bool servedReentrantly() const { return m_servedReentrantly; }
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index 5bb2d65..6841b21 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -10344,10 +10344,10 @@ int dataLength, int encodedDataLength) override { EXPECT_GT(dataLength, 16); - originalClient->didReceiveData(loader, data, 16, 16, 16); + originalClient->didReceiveData(loader, data, 16, 16); // This didReceiveData call shouldn't crash due to a failed assertion. originalClient->didReceiveData(loader, data + 16, dataLength - 16, - encodedDataLength - 16, dataLength - 16); + encodedDataLength - 16); } };
diff --git a/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp b/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp index 97691606c..f6855545 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp +++ b/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp
@@ -56,16 +56,17 @@ int dataLength, int encodedDataLength) { if (!m_currentRequest) - client->didReceiveData(loader, data, dataLength, encodedDataLength, - dataLength); + client->didReceiveData(loader, data, dataLength, encodedDataLength); } void SimNetwork::didFail(WebURLLoaderClient* client, WebURLLoader* loader, const WebURLError& error, - int64_t encodedDataLength) { + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) { if (!m_currentRequest) { - client->didFail(loader, error, encodedDataLength); + client->didFail(loader, error, totalEncodedDataLength, + totalEncodedBodyLength); return; } m_currentRequest->didFail(error); @@ -74,9 +75,11 @@ void SimNetwork::didFinishLoading(WebURLLoaderClient* client, WebURLLoader* loader, double finishTime, - int64_t totalEncodedDataLength) { + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) { if (!m_currentRequest) { - client->didFinishLoading(loader, finishTime, totalEncodedDataLength); + client->didFinishLoading(loader, finishTime, totalEncodedDataLength, + totalEncodedBodyLength); return; } m_currentRequest = nullptr;
diff --git a/third_party/WebKit/Source/web/tests/sim/SimNetwork.h b/third_party/WebKit/Source/web/tests/sim/SimNetwork.h index 62e4835..74bb74d 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimNetwork.h +++ b/third_party/WebKit/Source/web/tests/sim/SimNetwork.h
@@ -46,11 +46,13 @@ void didFail(WebURLLoaderClient*, WebURLLoader*, const WebURLError&, - int64_t totalEncodedDataLength) override; + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) override; void didFinishLoading(WebURLLoaderClient*, WebURLLoader*, double finishTime, - int64_t totalEncodedDataLength) override; + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) override; SimRequest* m_currentRequest; HashMap<String, SimRequest*> m_requests;
diff --git a/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp b/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp index df46ca5..9d18ee8 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp +++ b/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp
@@ -55,16 +55,18 @@ DCHECK(!m_error.reason); m_totalEncodedDataLength += data.length(); m_client->didReceiveData(m_loader, data.utf8().data(), data.length(), - data.length(), data.length()); + data.length()); } void SimRequest::finish() { DCHECK(m_isReady); if (m_error.reason) { - m_client->didFail(m_loader, m_error, m_totalEncodedDataLength); + m_client->didFail(m_loader, m_error, m_totalEncodedDataLength, + m_totalEncodedDataLength); } else { // TODO(esprehn): Is claiming a request time of 0 okay for tests? - m_client->didFinishLoading(m_loader, 0, m_totalEncodedDataLength); + m_client->didFinishLoading(m_loader, 0, m_totalEncodedDataLength, + m_totalEncodedDataLength); } reset(); }
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h index 2575418..82adfb6 100644 --- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h +++ b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h
@@ -26,6 +26,7 @@ #ifndef ArrayBuffer_h #define ArrayBuffer_h +#include "wtf/Assertions.h" #include "wtf/HashSet.h" #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" @@ -131,7 +132,8 @@ unsigned byteLength) { ArrayBufferContents contents(byteLength, 1, ArrayBufferContents::NotShared, ArrayBufferContents::DontInitialize); - RELEASE_ASSERT(contents.data()); + if (UNLIKELY(!contents.data())) + OOM_CRASH(); RefPtr<ArrayBuffer> buffer = adoptRef(new ArrayBuffer(contents)); memcpy(buffer->data(), source, byteLength); return buffer.release();
diff --git a/third_party/WebKit/public/platform/WebURLLoader.h b/third_party/WebKit/public/platform/WebURLLoader.h index c46d3d9..402cfb9 100644 --- a/third_party/WebKit/public/platform/WebURLLoader.h +++ b/third_party/WebKit/public/platform/WebURLLoader.h
@@ -59,7 +59,8 @@ WebURLResponse&, WebURLError&, WebData&, - int64_t& encodedDataLength) = 0; + int64_t& encodedDataLength, + int64_t& encodedBodyLength) = 0; // Load the request asynchronously, sending notifications to the given // client. The client will receive no further notifications if the
diff --git a/third_party/WebKit/public/platform/WebURLLoaderClient.h b/third_party/WebKit/public/platform/WebURLLoaderClient.h index e470bf46..5478d14 100644 --- a/third_party/WebKit/public/platform/WebURLLoaderClient.h +++ b/third_party/WebKit/public/platform/WebURLLoaderClient.h
@@ -87,14 +87,10 @@ // from cache, and -1 if this information is unavailable. // TODO(ricea): -1 is problematic for consumers maintaining a running // total. Investigate using 0 for all unavailable cases. - // |encodedBodyLength| is the number of bytes used to store this chunk, - // possibly encrypted, excluding headers or framing. It is set even if the - // response was served from cache. virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, - int encodedDataLength, - int encodedBodyLength) {} + int encodedDataLength) {} // Called when a chunk of renderer-generated metadata is received from the // cache. @@ -106,13 +102,15 @@ // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength. virtual void didFinishLoading(WebURLLoader* loader, double finishTime, - int64_t totalEncodedDataLength) {} + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) {} // Called when the load completes with an error. // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength. virtual void didFail(WebURLLoader*, const WebURLError&, - int64_t totalEncodedDataLength) {} + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength) {} // Value passed to didFinishLoading when total encoded data length isn't // known.
diff --git a/third_party/WebKit/public/platform/WebURLLoaderTestDelegate.h b/third_party/WebKit/public/platform/WebURLLoaderTestDelegate.h index 5256bc6..833cb7e5 100644 --- a/third_party/WebKit/public/platform/WebURLLoaderTestDelegate.h +++ b/third_party/WebKit/public/platform/WebURLLoaderTestDelegate.h
@@ -34,11 +34,13 @@ virtual void didFail(WebURLLoaderClient* originalClient, WebURLLoader*, const WebURLError&, - int64_t totalEncodedDataLength); + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength); virtual void didFinishLoading(WebURLLoaderClient* originalClient, WebURLLoader*, double finishTime, - int64_t totalEncodedDataLength); + int64_t totalEncodedDataLength, + int64_t totalEncodedBodyLength); }; } // namespace blink
diff --git a/third_party/WebKit/public/web/WebRuntimeFeatures.h b/third_party/WebKit/public/web/WebRuntimeFeatures.h index 0e0ab7ca..93a35277 100644 --- a/third_party/WebKit/public/web/WebRuntimeFeatures.h +++ b/third_party/WebKit/public/web/WebRuntimeFeatures.h
@@ -101,7 +101,6 @@ BLINK_EXPORT static void enablePaymentRequest(bool); BLINK_EXPORT static void enablePermissionsAPI(bool); BLINK_EXPORT static void enablePointerEvent(bool); - BLINK_EXPORT static void enablePointerEventV1SpecCapturing(bool); BLINK_EXPORT static void enablePreciseMemoryInfo(bool); BLINK_EXPORT static void enablePresentationAPI(bool); BLINK_EXPORT static void enablePushMessaging(bool);
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 50c656f..b96d36c 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -14191,6 +14191,132 @@ </summary> </histogram> +<histogram + name="Event.Latency.ScrollBegin.Touch.BrowserNotifiedToBeforeGpuSwap2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between the browser receives the notification of the first ScrollUpdate + gesture event in a given scroll gesture event sequence with touch source + induced renderer swap and GPU starts to swap. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Touch.GpuSwap2" units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between gpu starts to swap the first ScrollUpdate gesture event in a + given scroll gesture event sequence with touch source induced frame and the + swap finishes. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Touch.HandledToRendererSwap2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between the first ScrollUpdate gesture event in a given scroll gesture + event sequence with touch source, is handled on main/impl thread (specified + by suffix) and before renderer starts to swap. + </summary> +</histogram> + +<histogram + name="Event.Latency.ScrollBegin.Touch.RendererSwapToBrowserNotified2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between the renderer starts to swap a frame induced by the first + ScrollUpdate gesture event in a given scroll gesture event sequence with + touch source, and browser receives the swap notification. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Touch.TimeToHandled2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between initial creation of a touch event and the first generated + ScrollUpdate gesture event in a given scroll gesture event sequence is + handled on main/impl thread (specified by suffix). If no swap was induced by + the ScrollUpdate gesture event, no recording is made. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between initial creation of a touch event and the start of the frame + swap on the GPU service caused by the generated ScrollUpdate gesture event + if that ScrollUpdate is the first such event in a given scroll gesture event + sequence. If no swap was induced by the event, no recording is made. + </summary> +</histogram> + +<histogram + name="Event.Latency.ScrollBegin.Wheel.BrowserNotifiedToBeforeGpuSwap2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between the browser receives the notification of the first ScrollUpdate + gesture event in a given scroll gesture event sequence with wheel source + induced renderer swap and GPU starts to swap. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Wheel.GpuSwap2" units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between gpu starts to swap the first ScrollUpdate gesture event in a + given scroll gesture event sequence with wheel source induced frame and the + swap finishes. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Wheel.HandledToRendererSwap2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between the first ScrollUpdate gesture event in a given scroll gesture + event sequence with wheel source, is handled on main/impl thread (specified + by suffix) and before renderer starts to swap. + </summary> +</histogram> + +<histogram + name="Event.Latency.ScrollBegin.Wheel.RendererSwapToBrowserNotified2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between the renderer starts to swap a frame induced by the first + ScrollUpdate gesture event in a given scroll gesture event sequence with + wheel source, and browser receives the swap notification. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Wheel.TimeToHandled2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between initial creation of a wheel event and the first generated + ScrollUpdate gesture event in a given scroll gesture event sequence is + handled on main/impl thread (specified by suffix). If no swap was induced by + the ScrollBegin gesture event, no recording is made. + </summary> +</histogram> + +<histogram name="Event.Latency.ScrollBegin.Wheel.TimeToScrollUpdateSwapBegin2" + units="microseconds"> + <owner>tdresser@chromium.org</owner> + <summary> + Time between initial creation of a wheel event and the start of the frame + swap on the GPU service caused by the generated ScrollUpdate gesture event + if that ScrollUpdate is the first such event in a given scroll gesture event + sequence. If no swap was induced by the event, no recording is made. + </summary> +</histogram> + <histogram name="Event.Latency.ScrollUpdate.BrowserNotifiedToBeforeGpuSwap" units="microseconds"> <obsolete> @@ -14288,6 +14414,11 @@ <histogram name="Event.Latency.ScrollUpdate.Touch.TimeToFirstScrollUpdateSwapBegin2" units="microseconds"> + <obsolete> + To be replaced by + Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin2 in M57. + https://crbug.com/616482 + </obsolete> <owner>tdresser@chromium.org</owner> <summary> Time between initial creation of a touch event and the start of the frame @@ -14374,6 +14505,11 @@ <histogram name="Event.Latency.ScrollUpdate.Wheel.TimeToFirstScrollUpdateSwapBegin2" units="microseconds"> + <obsolete> + To be replaced by + Event.Latency.ScrollBegin.Wheel.TimeToScrollUpdateSwapBegin2 in M57. + https://crbug.com/616482 + </obsolete> <owner>tdresser@chromium.org</owner> <summary> Time between initial creation of a wheel event and the start of the frame @@ -78644,6 +78780,8 @@ <int value="18" label="Save media as"/> <int value="19" label="Share image"/> <int value="20" label="Open in new/other window"/> + <int value="21" label="Open (JavaScript evaluation)"/> + <int value="22" label="Read Later"/> </enum> <enum name="ContextMenuSaveLinkType" type="int">
diff --git a/tools/perf/benchmarks/dromaeo.py b/tools/perf/benchmarks/dromaeo.py index 82851186..9d3a9605 100644 --- a/tools/perf/benchmarks/dromaeo.py +++ b/tools/perf/benchmarks/dromaeo.py
@@ -236,11 +236,10 @@ return 'dromaeo.jslibeventprototype' -# win: http://crbug.com/479796, http://crbug.com/598705, -# http://crbug.com/668164 +# win: http://crbug.com/479796, http://crbug.com/598705 # android: http://crbug.com/503138 # linux: http://crbug.com/583075 -@benchmark.Disabled('win', 'win-reference', 'android', 'linux') +@benchmark.Disabled('win-reference', 'android', 'linux') class DromaeoJslibModifyJquery(_DromaeoBenchmark): """Dromaeo JSLib modify jquery JavaScript benchmark.
diff --git a/ui/events/latency_info.dot b/ui/events/latency_info.dot index 626384c..e234cd6 100644 --- a/ui/events/latency_info.dot +++ b/ui/events/latency_info.dot
@@ -13,24 +13,26 @@ INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT; INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT; - INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT -> INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT [label="Event.Latency.ScrollUpdate.HandledToRendererSwap_Main"]; - INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT [label="Event.Latency.ScrollUpdate.HandledToRendererSwap_Impl"]; + INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT -> INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT [label="Event.Latency.ScrollBegin/ScrollUpdate.*.HandledToRendererSwap2_Main"]; + INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT [label="Event.Latency.ScrollBegin/ScrollUpdate.*.HandledToRendererSwap2_Impl"]; - INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT -> INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT [label="Event.Latency.ScrollUpdate.RendererSwapToBrowserNotified"]; - INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT -> INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT [label="Event.Latency.ScrollUpdate.BrowserNotifiedToBeforeGpuSwap"]; - INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT -> INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT [label="Event.Latency.ScrollUpdate.GPUSwap"]; + INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT -> INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT [label="Event.Latency.ScrollBegin/ScrollUpdate.*.RendererSwapToBrowserNotified2"]; + INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT -> INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT [label="Event.Latency.ScrollBegin/ScrollUpdate.*.BrowserNotifiedToBeforeGpuSwap2"]; + INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT -> INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT [label="Event.Latency.ScrollBegin/ScrollUpdate.*.GpuSwap2"]; INPUT_EVENT_LATENCY_UI_COMPONENT -> INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT; edge[style="dashed"]; - INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT [label="Event.Latency.TouchToScrollUpdateSwapBegin"]; - INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT [label="Event.Latency.TouchToFirstScrollUpdateSwapBegin"]; + INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT [label="Event.Latency.ScrollUpdate.*.TimeToScrollUpdateSwapBegin2"]; + INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT [label="Event.Latency.ScrollBegin.*.TimeToScrollUpdateSwapBegin2"]; INPUT_EVENT_LATENCY_UI_COMPONENT -> INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT [label="Event.Latency.Browser.*UI"]; - INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT [label="Event.Latency.ScrollUpdate.TouchToHandled_Main"]; - INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT [label="Event.Latency.ScrollUpdate.TouchToHandled_Impl"]; + INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT [label="Event.Latency.ScrollUpdate.*.TimeToHandled2_Main"]; + INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT [label="Event.Latency.ScrollUpdate.*.TimeToHandled2_Impl"]; + INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT [label="Event.Latency.ScrollBegin.*.TimeToHandled2_Main"]; + INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT -> INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT [label="Event.Latency.ScrollBegin.*.TimeToHandled2_Impl"]; }