diff --git a/DEPS b/DEPS index dae274ce..139cdbb 100644 --- a/DEPS +++ b/DEPS
@@ -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': 'c48d544fa6f7ae1b22e0046be83eecd084690ae0', + 'catapult_revision': 'e8775f0f64bcae6b0789df6d4a2a5aca9f5cf4ac', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -416,7 +416,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': - Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '07d4626c40a501866d7c01954f8cabef7b50f482', + Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '8dbd2c59b33e12575b4d8e808d440863060c2fc7', # Dependency of chromite.git and skia. 'src/third_party/pyelftools':
diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd index a8403e6..6c46234 100644 --- a/ash/resources/ash_resources.grd +++ b/ash/resources/ash_resources.grd
@@ -15,7 +15,6 @@ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_LIST_BROWSER" file="common/shelf/window_switcher_icon_normal.png" /> <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_LIST_INCOGNITO_BROWSER" file="common/shelf/window_switcher_icon_incognito.png" /> <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_SETTINGS" file="common/shelf/settings_app_icon.png" /> - <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_MD_SETTINGS" file="common/shelf/md_settings_app_icon.png" /> <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_TASK_MANAGER" file="common/shelf/task_manager.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_MULTI_WINDOW_RESIZE_H" file="common/multi_window_resize_horizontal.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_MULTI_WINDOW_RESIZE_V" file="common/multi_window_resize_vertical.png" />
diff --git a/ash/resources/default_100_percent/common/shelf/md_settings_app_icon.png b/ash/resources/default_100_percent/common/shelf/md_settings_app_icon.png deleted file mode 100644 index f5495d463..0000000 --- a/ash/resources/default_100_percent/common/shelf/md_settings_app_icon.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_100_percent/common/shelf/settings_app_icon.png b/ash/resources/default_100_percent/common/shelf/settings_app_icon.png index fd46630..f5495d463 100644 --- a/ash/resources/default_100_percent/common/shelf/settings_app_icon.png +++ b/ash/resources/default_100_percent/common/shelf/settings_app_icon.png Binary files differ
diff --git a/ash/resources/default_200_percent/common/shelf/md_settings_app_icon.png b/ash/resources/default_200_percent/common/shelf/md_settings_app_icon.png deleted file mode 100644 index 58dea0cc..0000000 --- a/ash/resources/default_200_percent/common/shelf/md_settings_app_icon.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_200_percent/common/shelf/settings_app_icon.png b/ash/resources/default_200_percent/common/shelf/settings_app_icon.png index 5291f067..58dea0cc 100644 --- a/ash/resources/default_200_percent/common/shelf/settings_app_icon.png +++ b/ash/resources/default_200_percent/common/shelf/settings_app_icon.png Binary files differ
diff --git a/ash/system/network/network_state_list_detailed_view.cc b/ash/system/network/network_state_list_detailed_view.cc index 2fd64f3..a270762 100644 --- a/ash/system/network/network_state_list_detailed_view.cc +++ b/ash/system/network/network_state_list_detailed_view.cc
@@ -371,13 +371,10 @@ nullptr); } if (list_type_ != LIST_TYPE_VPN) { - bool scanning = + const bool scanning = NetworkHandler::Get()->network_state_handler()->GetScanningByType( NetworkTypePattern::WiFi()); ShowProgress(-1, scanning); - info_button_->SetTooltipText(l10n_util::GetStringUTF16( - scanning ? IDS_ASH_STATUS_TRAY_WIFI_SCANNING_MESSAGE - : IDS_ASH_STATUS_TRAY_NETWORK_INFO)); } }
diff --git a/ash/system/tray/tray_constants.cc b/ash/system/tray/tray_constants.cc index f23f9f0..19038b46 100644 --- a/ash/system/tray/tray_constants.cc +++ b/ash/system/tray/tray_constants.cc
@@ -63,7 +63,7 @@ const int kTrayToggleButtonWidth = 68; -const SkColor kBackgroundColor = SkColorSetRGB(0xfe, 0xfe, 0xfe); +const SkColor kBackgroundColor = SK_ColorWHITE; const SkColor kPublicAccountUserCardTextColor = SkColorSetRGB(0x66, 0x66, 0x66); const SkColor kPublicAccountUserCardNameColor = SK_ColorBLACK;
diff --git a/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java b/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java index 922536b..465c23a5 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java +++ b/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java
@@ -84,7 +84,7 @@ new AndroidRunnerParams(InstrumentationRegistry.getInstrumentation(), InstrumentationRegistry.getArguments(), false, 0L, false)); mSkipChecks = mergeList(checks, defaultSkipChecks()); - mPreTestHooks = defaultPreTestHooks(); + mPreTestHooks = mergeList(hooks, defaultPreTestHooks()); } /** @@ -119,7 +119,7 @@ * Change this static function to add or take out default {@code PreTestHook}s. */ private static List<PreTestHook> defaultPreTestHooks() { - return new ArrayList<PreTestHook>(); + return null; } /**
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java b/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java index 85a57611..d5579e3 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java +++ b/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java
@@ -6,7 +6,7 @@ import android.content.Context; -import junit.framework.Assert; +import org.junit.Assert; import org.chromium.base.BaseChromiumApplication; import org.chromium.base.CommandLine;
diff --git a/build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn b/build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn index c4ca09c..4d385dd 100644 --- a/build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn +++ b/build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn
@@ -12,6 +12,8 @@ "mac/crash_report_exception_handler.h", "mac/exception_handler_server.cc", "mac/exception_handler_server.h", + "mac/file_limit_annotation.cc", + "mac/file_limit_annotation.h", "prune_crash_reports_thread.cc", "prune_crash_reports_thread.h", "user_stream_data_source.cc",
diff --git a/build/secondary/third_party/crashpad/crashpad/util/BUILD.gn b/build/secondary/third_party/crashpad/crashpad/util/BUILD.gn index 7695e18a..01f4c67 100644 --- a/build/secondary/third_party/crashpad/crashpad/util/BUILD.gn +++ b/build/secondary/third_party/crashpad/crashpad/util/BUILD.gn
@@ -145,6 +145,7 @@ "stdlib/strlcpy.h", "stdlib/strnlen.cc", "stdlib/strnlen.h", + "stdlib/thread_safe_vector.h", "string/split_string.cc", "string/split_string.h", "synchronization/semaphore.h",
diff --git a/cc/layers/effect_tree_layer_list_iterator.cc b/cc/layers/effect_tree_layer_list_iterator.cc index a5228dc..72c14d3e 100644 --- a/cc/layers/effect_tree_layer_list_iterator.cc +++ b/cc/layers/effect_tree_layer_list_iterator.cc
@@ -43,20 +43,6 @@ EffectTreeLayerListIterator::~EffectTreeLayerListIterator() {} -// Finds the lowest common ancestor that has a render surface. -static int LowestCommonAncestor(int effect_id_1, - int effect_id_2, - const EffectTree* effect_tree) { - while (effect_id_1 != effect_id_2) { - if (effect_id_1 < effect_id_2) - effect_id_2 = effect_tree->Node(effect_id_2)->target_id; - else - effect_id_1 = effect_tree->Node(effect_id_1)->target_id; - } - - return effect_id_1; -} - void EffectTreeLayerListIterator::operator++() { switch (state_) { case State::LAYER: @@ -80,8 +66,9 @@ // If the next drawn layer has a different target effect tree index, check // for surfaces whose contributors have all been visited. if (next_effect_tree_index_ != current_effect_tree_index_) { - lowest_common_effect_tree_ancestor_index_ = LowestCommonAncestor( - current_effect_tree_index_, next_effect_tree_index_, effect_tree_); + lowest_common_effect_tree_ancestor_index_ = + effect_tree_->LowestCommonAncestorWithRenderSurface( + current_effect_tree_index_, next_effect_tree_index_); // If the current layer's target effect node is an ancestor of the next // layer's target effect node, then the current effect node still has // more contributors that need to be visited. Otherwise, all
diff --git a/cc/output/bsp_tree_perftest.cc b/cc/output/bsp_tree_perftest.cc index 3b954d1d..97bcfa3 100644 --- a/cc/output/bsp_tree_perftest.cc +++ b/cc/output/bsp_tree_perftest.cc
@@ -120,7 +120,6 @@ active_tree->OverscrollElasticityLayer(), max_texture_size, can_render_to_separate_surface, host_impl->settings().layer_transforms_should_scale_layer_contents, - false, // don't use layer lists for perf tests &update_list, active_tree->property_trees()); LayerTreeHostCommon::CalculateDrawProperties(&inputs); }
diff --git a/cc/paint/paint_canvas.h b/cc/paint/paint_canvas.h index 6b9a0df..aba97ceb 100644 --- a/cc/paint/paint_canvas.h +++ b/cc/paint/paint_canvas.h
@@ -170,10 +170,6 @@ virtual bool isClipRect() const = 0; virtual const SkMatrix& getTotalMatrix() const = 0; - // For GraphicsContextCanvas only. Maybe this could be rewritten? - virtual void temporary_internal_describeTopLayer(SkMatrix* matrix, - SkIRect* clip_bounds) = 0; - virtual bool ToPixmap(SkPixmap* output) = 0; enum class AnnotationType {
diff --git a/cc/paint/skia_paint_canvas.cc b/cc/paint/skia_paint_canvas.cc index bfc38b6..e29d816 100644 --- a/cc/paint/skia_paint_canvas.cc +++ b/cc/paint/skia_paint_canvas.cc
@@ -267,12 +267,6 @@ return canvas_->getTotalMatrix(); } -void SkiaPaintCanvas::temporary_internal_describeTopLayer( - SkMatrix* matrix, - SkIRect* clip_bounds) { - return canvas_->temporary_internal_describeTopLayer(matrix, clip_bounds); -} - void SkiaPaintCanvas::PlaybackPaintRecord(sk_sp<const PaintRecord> record) { record->playback(canvas_); }
diff --git a/cc/paint/skia_paint_canvas.h b/cc/paint/skia_paint_canvas.h index 47dba86..c1decfc7 100644 --- a/cc/paint/skia_paint_canvas.h +++ b/cc/paint/skia_paint_canvas.h
@@ -134,9 +134,6 @@ bool isClipRect() const override; const SkMatrix& getTotalMatrix() const override; - void temporary_internal_describeTopLayer(SkMatrix* matrix, - SkIRect* clip_bounds) override; - bool ToPixmap(SkPixmap* output) override; void Annotate(AnnotationType type, const SkRect& rect,
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc index a5e31dd..91beec72 100644 --- a/cc/surfaces/surface_aggregator.cc +++ b/cc/surfaces/surface_aggregator.cc
@@ -144,8 +144,7 @@ } int SurfaceAggregator::ChildIdForSurface(Surface* surface) { - SurfaceToResourceChildIdMap::iterator it = - surface_id_to_resource_child_id_.find(surface->surface_id()); + auto it = surface_id_to_resource_child_id_.find(surface->surface_id()); if (it == surface_id_to_resource_child_id_.end()) { int child_id = provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory())); @@ -239,7 +238,7 @@ return; } - SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first; + referenced_surfaces_.insert(surface_id); // TODO(vmpstr): provider check is a hack for unittests that don't set up a // resource provider. ResourceProvider::ResourceIdMap empty_map; @@ -337,7 +336,8 @@ gfx::RectF(surface_quad->rect)); } - referenced_surfaces_.erase(it); + // Need to re-query since referenced_surfaces_ iterators are not stable. + referenced_surfaces_.erase(referenced_surfaces_.find(surface_id)); } void SurfaceAggregator::AddColorConversionPass() { @@ -568,8 +568,7 @@ for (const auto& surface : previous_contained_surfaces_) { if (!contained_surfaces_.count(surface.first)) { // Release resources of removed surface. - SurfaceToResourceChildIdMap::iterator it = - surface_id_to_resource_child_id_.find(surface.first); + auto it = surface_id_to_resource_child_id_.find(surface.first); if (it != surface_id_to_resource_child_id_.end()) { provider_->DestroyChild(it->second); surface_id_to_resource_child_id_.erase(it); @@ -653,13 +652,18 @@ }; std::vector<SurfaceInfo> child_surfaces; - std::unordered_set<int> pixel_moving_background_filter_passes; + // This data is created once and typically small or empty. Collect all items + // and pass to a flat_vector to sort once. + std::vector<int> pixel_moving_background_filter_passes_data; for (const auto& render_pass : frame.render_pass_list) { if (render_pass->background_filters.HasFilterThatMovesPixels()) { - pixel_moving_background_filter_passes.insert( + pixel_moving_background_filter_passes_data.push_back( RemapPassId(render_pass->id, surface_id)); } } + base::flat_set<int> pixel_moving_background_filter_passes( + std::move(pixel_moving_background_filter_passes_data), + base::KEEP_FIRST_OF_DUPES); for (const auto& render_pass : base::Reversed(frame.render_pass_list)) { int remapped_pass_id = RemapPassId(render_pass->id, surface_id); @@ -728,8 +732,7 @@ // Avoid infinite recursion by adding current surface to // referenced_surfaces_. - SurfaceSet::iterator it = - referenced_surfaces_.insert(surface->surface_id()).first; + referenced_surfaces_.insert(surface->surface_id()); for (const auto& surface_info : child_surfaces) { gfx::Rect surface_damage = PrewalkTree(surface_info.id, surface_info.has_moved_pixels, @@ -769,7 +772,7 @@ } } - referenced_surfaces_.erase(it); + referenced_surfaces_.erase(referenced_surfaces_.find(surface->surface_id())); if (!damage_rect.IsEmpty() && frame.metadata.may_contain_video) result->may_contain_video = true; return damage_rect; @@ -810,7 +813,7 @@ } } } else { - SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first; + auto it = referenced_surfaces_.insert(surface_id).first; CopyPasses(frame, surface); referenced_surfaces_.erase(it); } @@ -860,7 +863,7 @@ frame.metadata.may_contain_video = prewalk_result.may_contain_video; CopyUndrawnSurfaces(&prewalk_result); - SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first; + auto it = referenced_surfaces_.insert(surface_id).first; CopyPasses(root_surface_frame, surface); referenced_surfaces_.erase(it); AddColorConversionPass(); @@ -890,10 +893,8 @@ contained_surfaces_.swap(previous_contained_surfaces_); contained_surfaces_.clear(); - for (SurfaceIndexMap::iterator it = previous_contained_surfaces_.begin(); - it != previous_contained_surfaces_.end(); - ++it) { - Surface* surface = manager_->GetSurfaceForId(it->first); + for (auto it : previous_contained_surfaces_) { + Surface* surface = manager_->GetSurfaceForId(it.first); if (surface) surface->TakeLatencyInfo(&frame.metadata.latency_info); } @@ -914,8 +915,7 @@ } void SurfaceAggregator::ReleaseResources(const SurfaceId& surface_id) { - SurfaceToResourceChildIdMap::iterator it = - surface_id_to_resource_child_id_.find(surface_id); + auto it = surface_id_to_resource_child_id_.find(surface_id); if (it != surface_id_to_resource_child_id_.end()) { provider_->DestroyChild(it->second); surface_id_to_resource_child_id_.erase(it);
diff --git a/cc/surfaces/surface_aggregator.h b/cc/surfaces/surface_aggregator.h index ec69f5d..5fe0c3d7 100644 --- a/cc/surfaces/surface_aggregator.h +++ b/cc/surfaces/surface_aggregator.h
@@ -5,12 +5,10 @@ #ifndef CC_SURFACES_SURFACE_AGGREGATOR_H_ #define CC_SURFACES_SURFACE_AGGREGATOR_H_ -#include <map> #include <memory> -#include <set> -#include <unordered_map> -#include <unordered_set> +#include "base/containers/flat_map.h" +#include "base/containers/flat_set.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "cc/quads/draw_quad.h" @@ -30,7 +28,7 @@ class CC_SURFACES_EXPORT SurfaceAggregator { public: - using SurfaceIndexMap = std::unordered_map<SurfaceId, int, SurfaceIdHash>; + using SurfaceIndexMap = base::flat_map<SurfaceId, int>; SurfaceAggregator(SurfaceManager* manager, ResourceProvider* provider, @@ -65,7 +63,7 @@ ~PrewalkResult(); // This is the set of Surfaces that were referenced by another Surface, but // not included in a SurfaceDrawQuad. - std::set<SurfaceId> undrawn_surfaces; + base::flat_set<SurfaceId> undrawn_surfaces; bool may_contain_video = false; }; @@ -145,9 +143,8 @@ // each source (SurfaceId, RenderPass id) to a unified ID namespace that's // used in the aggregated frame. An entry is removed from the map if it's not // used for one output frame. - using RenderPassIdAllocatorMap = - std::map<std::pair<SurfaceId, int>, RenderPassInfo>; - RenderPassIdAllocatorMap render_pass_allocator_map_; + base::flat_map<std::pair<SurfaceId, int>, RenderPassInfo> + render_pass_allocator_map_; int next_render_pass_id_; const bool aggregate_only_damaged_; bool output_is_secure_; @@ -162,9 +159,7 @@ // The id for the final color conversion render pass. int color_conversion_render_pass_id_ = 0; - using SurfaceToResourceChildIdMap = - std::unordered_map<SurfaceId, int, SurfaceIdHash>; - SurfaceToResourceChildIdMap surface_id_to_resource_child_id_; + base::flat_map<SurfaceId, int> surface_id_to_resource_child_id_; // The following state is only valid for the duration of one Aggregate call // and is only stored on the class to avoid having to pass through every @@ -172,8 +167,7 @@ // This is the set of surfaces referenced in the aggregation so far, used to // detect cycles. - using SurfaceSet = std::set<SurfaceId>; - SurfaceSet referenced_surfaces_; + base::flat_set<SurfaceId> referenced_surfaces_; // For each Surface used in the last aggregation, gives the frame_index at // that time. @@ -181,22 +175,22 @@ SurfaceIndexMap contained_surfaces_; // After surface validation, every Surface in this set is valid. - std::unordered_set<SurfaceId, SurfaceIdHash> valid_surfaces_; + base::flat_set<SurfaceId> valid_surfaces_; // This is the pass list for the aggregated frame. RenderPassList* dest_pass_list_; // This is the set of aggregated pass ids that are affected by filters that // move pixels. - std::unordered_set<int> moved_pixel_passes_; + base::flat_set<int> moved_pixel_passes_; // This is the set of aggregated pass ids that are drawn by copy requests, so // should not have their damage rects clipped to the root damage rect. - std::unordered_set<int> copy_request_passes_; + base::flat_set<int> copy_request_passes_; // This maps each aggregated pass id to the set of (aggregated) pass ids // that its RenderPassDrawQuads depend on - std::unordered_map<int, std::unordered_set<int>> render_pass_dependencies_; + base::flat_map<int, base::flat_set<int>> render_pass_dependencies_; // The root damage rect of the currently-aggregating frame. gfx::Rect root_damage_rect_;
diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc index aa4a6236..4ce0dca 100644 --- a/cc/trees/damage_tracker.cc +++ b/cc/trees/damage_tracker.cc
@@ -14,6 +14,7 @@ #include "cc/layers/heads_up_display_layer_impl.h" #include "cc/layers/layer_impl.h" #include "cc/layers/render_surface_impl.h" +#include "cc/trees/effect_node.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_impl.h" #include "ui/gfx/geometry/rect_conversions.h" @@ -29,18 +30,14 @@ DamageTracker::~DamageTracker() {} -void DamageTracker::UpdateDamageTrackingState( - const LayerImplList& layer_list, - const RenderSurfaceImpl* target_surface, - bool target_surface_property_changed_only_from_descendant, - const gfx::Rect& target_surface_content_rect, - LayerImpl* target_surface_mask_layer, - const FilterOperations& filters) { +void DamageTracker::UpdateDamageTracking( + LayerTreeImpl* layer_tree_impl, + const LayerImplList& render_surface_list) { // - // This function computes the "damage rect" of a target surface, and updates - // the state that is used to correctly track damage across frames. The damage - // rect is the region of the surface that may have changed and needs to be - // redrawn. This can be used to scissor what is actually drawn, to save GPU + // This function computes the "damage rect" of each target surface, and + // updates the state that is used to correctly track damage across frames. The + // damage rect is the region of the surface that may have changed and needs to + // be redrawn. This can be used to scissor what is actually drawn, to save GPU // computation and bandwidth. // // The surface's damage rect is computed as the union of all possible changes @@ -52,25 +49,30 @@ // // The basic algorithm for computing the damage region is as follows: // - // 1. compute damage caused by changes in active/new layers - // for each layer in the layer_list: - // if the layer is actually a render_surface: - // add the surface's damage to our target surface. - // else - // add the layer's damage to the target surface. + // 1. compute damage caused by changes in contributing layers or surfaces + // for each contributing layer or render surface: + // add the layer's or surface's damage to the target surface. // // 2. compute damage caused by the target surface's mask, if it exists. // // 3. compute damage caused by old layers/surfaces that no longer exist - // for each leftover layer: + // for each leftover layer or render surface: // add the old layer/surface bounds to the target surface damage. // // 4. combine all partial damage rects to get the full damage rect. // // Additional important points: // - // - This algorithm is implicitly recursive; it assumes that descendant - // surfaces have already computed their damage. + // - This algorithm requires that descendant surfaces compute their damage + // before ancestor surfaces. Further, since contributing surfaces with + // background filters can expand the damage caused by contributors + // underneath them (that is, before them in draw order), the exact damage + // caused by these contributors must be computed before computing the damage + // caused by the contributing surface. This is implemented by visiting + // layers in draw order, computing the damage caused by each one to their + // target; during this walk, as soon as all of a surface's contributors have + // been visited, the surface's own damage is computed and then added to its + // target's accumulated damage. // // - Changes to layers/surfaces indicate "damage" to the target surface; If a // layer is not changed, it does NOT mean that the layer can skip drawing. @@ -104,40 +106,98 @@ // erased from map. // - PrepareRectHistoryForUpdate(); + for (LayerImpl* layer : render_surface_list) { + layer->GetRenderSurface()->damage_tracker()->PrepareForUpdate(); + } + + EffectTree& effect_tree = layer_tree_impl->property_trees()->effect_tree; + int current_target_effect_id = EffectTree::kContentsRootNodeId; + DCHECK(effect_tree.GetRenderSurface(current_target_effect_id)); + for (LayerImpl* layer : *layer_tree_impl) { + if (!layer->is_drawn_render_surface_layer_list_member()) + continue; + + int next_target_effect_id = layer->render_target_effect_tree_index(); + if (next_target_effect_id != current_target_effect_id) { + int lowest_common_ancestor_id = + effect_tree.LowestCommonAncestorWithRenderSurface( + current_target_effect_id, next_target_effect_id); + while (current_target_effect_id != lowest_common_ancestor_id) { + // Moving to a non-descendant target surface. This implies that the + // current target doesn't have any more contributors, since only + // descendants can contribute to a target, and the each's target's + // content (including content contributed by descendants) is contiguous + // in draw order. + RenderSurfaceImpl* current_target = + effect_tree.GetRenderSurface(current_target_effect_id); + current_target->damage_tracker()->ComputeSurfaceDamage(current_target); + RenderSurfaceImpl* parent_target = current_target->render_target(); + parent_target->damage_tracker()->AccumulateDamageFromRenderSurface( + current_target); + current_target_effect_id = + effect_tree.Node(current_target_effect_id)->target_id; + } + current_target_effect_id = next_target_effect_id; + } + + RenderSurfaceImpl* target_surface = layer->render_target(); + + // We skip damage from the HUD layer because (a) the HUD layer damages the + // whole frame and (b) we don't want HUD layer damage to be shown by the + // HUD damage rect visualization. + if (layer != layer_tree_impl->hud_layer()) { + target_surface->damage_tracker()->AccumulateDamageFromLayer(layer); + } + } + + DCHECK_GE(current_target_effect_id, EffectTree::kContentsRootNodeId); + RenderSurfaceImpl* current_target = + effect_tree.GetRenderSurface(current_target_effect_id); + while (true) { + current_target->damage_tracker()->ComputeSurfaceDamage(current_target); + if (current_target->EffectTreeIndex() == EffectTree::kContentsRootNodeId) + break; + RenderSurfaceImpl* next_target = current_target->render_target(); + next_target->damage_tracker()->AccumulateDamageFromRenderSurface( + current_target); + current_target = next_target; + } +} + +void DamageTracker::ComputeSurfaceDamage(RenderSurfaceImpl* render_surface) { + // All damage from contributing layers and surfaces must already have been + // added to damage_for_this_update_ through calls to AccumulateDamageFromLayer + // and AccumulateDamageFromRenderSurface. + // These functions cannot be bypassed with early-exits, even if we know what // the damage will be for this frame, because we need to update the damage // tracker state to correctly track the next frame. - DamageAccumulator damage_from_active_layers = - TrackDamageFromActiveLayers(layer_list, target_surface); DamageAccumulator damage_from_surface_mask = - TrackDamageFromSurfaceMask(target_surface_mask_layer); + TrackDamageFromSurfaceMask(render_surface->MaskLayer()); DamageAccumulator damage_from_leftover_rects = TrackDamageFromLeftoverRects(); - DamageAccumulator damage_for_this_update; - - if (target_surface_property_changed_only_from_descendant) { - damage_for_this_update.Union(target_surface_content_rect); + if (render_surface->SurfacePropertyChangedOnlyFromDescendant()) { + damage_for_this_update_ = DamageAccumulator(); + damage_for_this_update_.Union(render_surface->content_rect()); } else { // TODO(shawnsingh): can we clamp this damage to the surface's content rect? // (affects performance, but not correctness) - damage_for_this_update.Union(damage_from_active_layers); - damage_for_this_update.Union(damage_from_surface_mask); - damage_for_this_update.Union(damage_from_leftover_rects); + damage_for_this_update_.Union(damage_from_surface_mask); + damage_for_this_update_.Union(damage_from_leftover_rects); gfx::Rect damage_rect; - bool is_rect_valid = damage_for_this_update.GetAsRect(&damage_rect); + bool is_rect_valid = damage_for_this_update_.GetAsRect(&damage_rect); if (is_rect_valid) { - damage_rect = - filters.MapRect(damage_rect, target_surface->SurfaceScale().matrix()); - damage_for_this_update = DamageAccumulator(); - damage_for_this_update.Union(damage_rect); + damage_rect = render_surface->Filters().MapRect( + damage_rect, render_surface->SurfaceScale().matrix()); + damage_for_this_update_ = DamageAccumulator(); + damage_for_this_update_.Union(damage_rect); } } // Damage accumulates until we are notified that we actually did draw on that // frame. - current_damage_.Union(damage_for_this_update); + current_damage_.Union(damage_for_this_update_); } bool DamageTracker::GetDamageRectIfValid(gfx::Rect* rect) { @@ -177,31 +237,6 @@ return *it; } -DamageTracker::DamageAccumulator DamageTracker::TrackDamageFromActiveLayers( - const LayerImplList& layer_list, - const RenderSurfaceImpl* target_surface) { - DamageAccumulator damage; - - for (size_t layer_index = 0; layer_index < layer_list.size(); ++layer_index) { - // Visit layers in back-to-front order. - LayerImpl* layer = layer_list[layer_index]; - - // We skip damage from the HUD layer because (a) the HUD layer damages the - // whole frame and (b) we don't want HUD layer damage to be shown by the - // HUD damage rect visualization. - if (layer == layer->layer_tree_impl()->hud_layer()) - continue; - - RenderSurfaceImpl* render_surface = layer->GetRenderSurface(); - if (render_surface && render_surface != target_surface) - ExtendDamageForRenderSurface(render_surface, &damage); - else - ExtendDamageForLayer(layer, &damage); - } - - return damage; -} - DamageTracker::DamageAccumulator DamageTracker::TrackDamageFromSurfaceMask( LayerImpl* target_surface_mask_layer) { DamageAccumulator damage; @@ -220,8 +255,9 @@ return damage; } -void DamageTracker::PrepareRectHistoryForUpdate() { +void DamageTracker::PrepareForUpdate() { mailboxId_++; + damage_for_this_update_ = DamageAccumulator(); } DamageTracker::DamageAccumulator DamageTracker::TrackDamageFromLeftoverRects() { @@ -292,12 +328,11 @@ void DamageTracker::ExpandDamageInsideRectWithFilters( const gfx::Rect& pre_filter_rect, - const FilterOperations& filters, - DamageAccumulator* damage) { + const FilterOperations& filters) { gfx::Rect damage_rect; - bool is_valid_rect = damage->GetAsRect(&damage_rect); - // If the input isn't a valid rect, then there is no point in trying to make - // it bigger. + bool is_valid_rect = damage_for_this_update_.GetAsRect(&damage_rect); + // If the damage accumulated so far isn't a valid rect, then there is no point + // in trying to make it bigger. if (!is_valid_rect) return; @@ -308,11 +343,10 @@ // Restrict it to the rectangle in which the background filter is shown. expanded_damage_rect.Intersect(pre_filter_rect); - damage->Union(expanded_damage_rect); + damage_for_this_update_.Union(expanded_damage_rect); } -void DamageTracker::ExtendDamageForLayer(LayerImpl* layer, - DamageAccumulator* target_damage) { +void DamageTracker::AccumulateDamageFromLayer(LayerImpl* layer) { // There are two ways that a layer can damage a region of the target surface: // 1. Property change (e.g. opacity, position, transforms): // - the entire region of the layer itself damages the surface. @@ -341,11 +375,11 @@ if (layer_is_new || layer->LayerPropertyChanged()) { // If a layer is new or has changed, then its entire layer rect affects the // target surface. - target_damage->Union(rect_in_target_space); + damage_for_this_update_.Union(rect_in_target_space); // The layer's old region is now exposed on the target surface, too. // Note old_rect_in_target_space is already in target space. - target_damage->Union(old_rect_in_target_space); + damage_for_this_update_.Union(old_rect_in_target_space); return; } @@ -357,13 +391,12 @@ if (!damage_rect.IsEmpty()) { gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect(layer->DrawTransform(), damage_rect); - target_damage->Union(damage_rect_in_target_space); + damage_for_this_update_.Union(damage_rect_in_target_space); } } -void DamageTracker::ExtendDamageForRenderSurface( - RenderSurfaceImpl* render_surface, - DamageAccumulator* target_damage) { +void DamageTracker::AccumulateDamageFromRenderSurface( + RenderSurfaceImpl* render_surface) { // There are two ways a "descendant surface" can damage regions of the "target // surface": // 1. Property change: @@ -390,10 +423,10 @@ if (surface_is_new || render_surface->SurfacePropertyChanged()) { // The entire surface contributes damage. - target_damage->Union(surface_rect_in_target_space); + damage_for_this_update_.Union(surface_rect_in_target_space); // The surface's old region is now exposed on the target surface, too. - target_damage->Union(old_surface_rect); + damage_for_this_update_.Union(old_surface_rect); } else { // Only the surface's damage_rect will damage the target surface. gfx::Rect damage_rect_in_local_space; @@ -405,9 +438,9 @@ const gfx::Transform& draw_transform = render_surface->draw_transform(); gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect( draw_transform, damage_rect_in_local_space); - target_damage->Union(damage_rect_in_target_space); + damage_for_this_update_.Union(damage_rect_in_target_space); } else if (!is_valid_rect) { - target_damage->Union(surface_rect_in_target_space); + damage_for_this_update_.Union(surface_rect_in_target_space); } } @@ -421,7 +454,7 @@ render_surface->BackgroundFilters(); if (background_filters.HasFilterThatMovesPixels()) { ExpandDamageInsideRectWithFilters(surface_rect_in_target_space, - background_filters, target_damage); + background_filters); } }
diff --git a/cc/trees/damage_tracker.h b/cc/trees/damage_tracker.h index 6ddc504..c6d2446b 100644 --- a/cc/trees/damage_tracker.h +++ b/cc/trees/damage_tracker.h
@@ -21,6 +21,7 @@ class FilterOperations; class LayerImpl; +class LayerTreeImpl; class RenderSurfaceImpl; // Computes the region where pixels have actually changed on a @@ -31,15 +32,11 @@ static std::unique_ptr<DamageTracker> Create(); ~DamageTracker(); + static void UpdateDamageTracking(LayerTreeImpl* layer_tree_impl, + const LayerImplList& render_surface_list); + void DidDrawDamagedArea() { current_damage_ = DamageAccumulator(); } void AddDamageNextUpdate(const gfx::Rect& dmg) { current_damage_.Union(dmg); } - void UpdateDamageTrackingState( - const LayerImplList& layer_list, - const RenderSurfaceImpl* target_surface, - bool target_surface_property_changed_only_from_descendant, - const gfx::Rect& target_surface_content_rect, - LayerImpl* target_surface_mask_layer, - const FilterOperations& filters); bool GetDamageRectIfValid(gfx::Rect* rect); @@ -84,21 +81,17 @@ int bottom_ = 0; }; - DamageAccumulator TrackDamageFromActiveLayers( - const LayerImplList& layer_list, - const RenderSurfaceImpl* target_surface); DamageAccumulator TrackDamageFromSurfaceMask( LayerImpl* target_surface_mask_layer); DamageAccumulator TrackDamageFromLeftoverRects(); - void PrepareRectHistoryForUpdate(); - // These helper functions are used only in TrackDamageFromActiveLayers(). - void ExtendDamageForLayer(LayerImpl* layer, DamageAccumulator* target_damage); - void ExtendDamageForRenderSurface(RenderSurfaceImpl* render_surface, - DamageAccumulator* target_damage); + // These helper functions are used only during UpdateDamageTracking(). + void PrepareForUpdate(); + void AccumulateDamageFromLayer(LayerImpl* layer); + void AccumulateDamageFromRenderSurface(RenderSurfaceImpl* render_surface); + void ComputeSurfaceDamage(RenderSurfaceImpl* render_surface); void ExpandDamageInsideRectWithFilters(const gfx::Rect& pre_filter_rect, - const FilterOperations& filters, - DamageAccumulator* damage); + const FilterOperations& filters); struct LayerRectMapData { LayerRectMapData() : layer_id_(0), mailboxId_(0) {} @@ -147,6 +140,9 @@ unsigned int mailboxId_; DamageAccumulator current_damage_; + // Damage accumulated since the last call to PrepareForUpdate(). + DamageAccumulator damage_for_this_update_; + DISALLOW_COPY_AND_ASSIGN(DamageTracker); };
diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc index 91cec6d..c633067 100644 --- a/cc/trees/damage_tracker_unittest.cc +++ b/cc/trees/damage_tracker_unittest.cc
@@ -57,19 +57,8 @@ ExecuteCalculateDrawProperties(root, device_scale_factor, &render_surface_layer_list); - // Iterate back-to-front, so that damage correctly propagates from descendant - // surfaces to ancestors. - size_t render_surface_layer_list_size = render_surface_layer_list.size(); - for (size_t i = 0; i < render_surface_layer_list_size; ++i) { - size_t index = render_surface_layer_list_size - 1 - i; - RenderSurfaceImpl* target_surface = - render_surface_layer_list[index]->GetRenderSurface(); - target_surface->damage_tracker()->UpdateDamageTrackingState( - target_surface->layer_list(), target_surface, - target_surface->SurfacePropertyChangedOnlyFromDescendant(), - target_surface->content_rect(), target_surface->MaskLayer(), - target_surface->Filters()); - } + DamageTracker::UpdateDamageTracking(root->layer_tree_impl(), + render_surface_layer_list); root->layer_tree_impl()->ResetAllChangeTracking(); } @@ -1344,10 +1333,7 @@ EXPECT_EQ(gfx::Rect(30, 31, 14, 15).ToString(), root_damage_rect.ToString()); } -TEST_F(DamageTrackerTest, VerifyDamageForEmptyLayerList) { - // Though it should never happen, its a good idea to verify that the damage - // tracker does not crash when it receives an empty layer_list. - +TEST_F(DamageTrackerTest, VerifyDamageWithNoContributingLayers) { std::unique_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.active_tree(), 1); root->test_properties()->force_render_surface = true; @@ -1358,11 +1344,6 @@ DCHECK_EQ(root_ptr->GetRenderSurface(), root_ptr->render_target()); RenderSurfaceImpl* target_surface = root_ptr->GetRenderSurface(); - - LayerImplList empty_list; - target_surface->damage_tracker()->UpdateDamageTrackingState( - empty_list, target_surface, false, gfx::Rect(), NULL, FilterOperations()); - gfx::Rect damage_rect; EXPECT_TRUE( target_surface->damage_tracker()->GetDamageRectIfValid(&damage_rect)); @@ -1530,15 +1511,11 @@ LayerImplList render_surface_layer_list; ExecuteCalculateDrawProperties(root, device_scale_factor, &render_surface_layer_list); - - auto* surface = child1->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); - surface = root->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); + // Avoid the descendant-only property change path that skips unioning damage + // from descendant layers. + child1->GetRenderSurface()->NoteAncestorPropertyChanged(); + DamageTracker::UpdateDamageTracking(host_impl_.active_tree(), + render_surface_layer_list); // The expected damage would be too large to store in a gfx::Rect, so we // should damage everything on child1. @@ -1568,14 +1545,8 @@ render_surface_layer_list.clear(); ExecuteCalculateDrawProperties(root, device_scale_factor, &render_surface_layer_list); - surface = child1->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); - surface = root->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); + DamageTracker::UpdateDamageTracking(host_impl_.active_tree(), + render_surface_layer_list); // Child1 should still not have a valid rect, since the union of the damage of // its children is not representable by a single rect. @@ -1624,15 +1595,11 @@ LayerImplList render_surface_layer_list; ExecuteCalculateDrawProperties(root, device_scale_factor, &render_surface_layer_list); - - auto* surface = child1->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); - surface = root->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); + // Avoid the descendant-only property change path that skips unioning damage + // from descendant layers. + child1->GetRenderSurface()->NoteAncestorPropertyChanged(); + DamageTracker::UpdateDamageTracking(host_impl_.active_tree(), + render_surface_layer_list); // The expected damage would be too large to store in a gfx::Rect, so we // should damage everything on child1. @@ -1662,14 +1629,8 @@ render_surface_layer_list.clear(); ExecuteCalculateDrawProperties(root, device_scale_factor, &render_surface_layer_list); - surface = child1->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); - surface = root->GetRenderSurface(); - surface->damage_tracker()->UpdateDamageTrackingState( - surface->layer_list(), surface, false, surface->content_rect(), - surface->MaskLayer(), surface->Filters()); + DamageTracker::UpdateDamageTracking(host_impl_.active_tree(), + render_surface_layer_list); // Child1 should still not have a valid rect, since the union of the damage of // its children is not representable by a single rect.
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc index 27eb425d..e38d14a 100644 --- a/cc/trees/draw_property_utils.cc +++ b/cc/trees/draw_property_utils.cc
@@ -743,23 +743,6 @@ } } -static void UpdateScrollTree(ScrollTree* scroll_tree, - const LayerTreeHost* layer_tree_host) { - if (!scroll_tree->needs_update()) - return; - - for (int i = ScrollTree::kRootNodeId; - i < static_cast<int>(scroll_tree->size()); ++i) { - ScrollNode* scroll_node = scroll_tree->Node(i); - if (Layer* scroll_layer = - layer_tree_host->LayerById(scroll_node->owning_layer_id)) { - if (Layer* scroll_clip_layer = scroll_layer->scroll_clip_layer()) { - scroll_node->scroll_clip_layer_bounds = scroll_clip_layer->bounds(); - } - } - } -} - static void ComputeClips(PropertyTrees* property_trees) { DCHECK(!property_trees->transform_tree.needs_update()); ClipTree* clip_tree = &property_trees->clip_tree; @@ -889,7 +872,6 @@ property_trees->clip_tree.set_needs_update(true); property_trees->effect_tree.set_needs_update(true); } - UpdateScrollTree(&property_trees->scroll_tree, layer_tree_host); ComputeTransforms(&property_trees->transform_tree); ComputeEffects(&property_trees->effect_tree); // Computation of clips uses ToScreen which is updated while computing @@ -1044,8 +1026,7 @@ } void ComputeSurfaceDrawProperties(PropertyTrees* property_trees, - RenderSurfaceImpl* render_surface, - const bool use_layer_lists) { + RenderSurfaceImpl* render_surface) { SetSurfaceIsClipped(property_trees->clip_tree, render_surface); SetSurfaceDrawOpacity(property_trees->effect_tree, render_surface); SetSurfaceDrawTransform(property_trees, render_surface);
diff --git a/cc/trees/draw_property_utils.h b/cc/trees/draw_property_utils.h index b5ff981..ee1f507 100644 --- a/cc/trees/draw_property_utils.h +++ b/cc/trees/draw_property_utils.h
@@ -65,8 +65,7 @@ const PropertyTrees* property_trees); void CC_EXPORT ComputeSurfaceDrawProperties(PropertyTrees* property_trees, - RenderSurfaceImpl* render_surface, - const bool use_layer_lists); + RenderSurfaceImpl* render_surface); bool CC_EXPORT LayerShouldBeSkipped(LayerImpl* layer, const TransformTree& transform_tree,
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc index 7169a2a..a3afacd0 100644 --- a/cc/trees/layer_tree_host_common.cc +++ b/cc/trees/layer_tree_host_common.cc
@@ -79,7 +79,6 @@ int max_texture_size, bool can_render_to_separate_surface, bool can_adjust_raster_scales, - bool use_layer_lists, LayerImplList* render_surface_layer_list, PropertyTrees* property_trees) : root_layer(root_layer), @@ -96,7 +95,6 @@ max_texture_size(max_texture_size), can_render_to_separate_surface(can_render_to_separate_surface), can_adjust_raster_scales(can_adjust_raster_scales), - use_layer_lists(use_layer_lists), render_surface_layer_list(render_surface_layer_list), property_trees(property_trees) {} @@ -119,7 +117,6 @@ std::numeric_limits<int>::max() / 2, true, false, - false, render_surface_layer_list, GetPropertyTrees(root_layer)) { DCHECK(root_layer); @@ -284,8 +281,7 @@ LayerTreeImpl* layer_tree_impl, PropertyTrees* property_trees, LayerImplList* render_surface_layer_list, - bool can_render_to_separate_surface, - bool use_layer_lists) { + bool can_render_to_separate_surface) { // Add all non-skipped surfaces to the initial render surface layer list. Add // all non-skipped layers to the layer list of their target surface, and // add their content rect to their target surface's accumulated content rect. @@ -325,8 +321,8 @@ contributes_to_drawn_surface); } - draw_property_utils::ComputeSurfaceDrawProperties( - property_trees, render_surface, use_layer_lists); + draw_property_utils::ComputeSurfaceDrawProperties(property_trees, + render_surface); // Ignore occlusion from outside the surface when surface contents need to // be fully drawn. Layers with copy-request need to be complete. We could @@ -436,7 +432,6 @@ PropertyTrees* property_trees, LayerImplList* render_surface_layer_list, const bool can_render_to_separate_surface, - const bool use_layer_lists, const int max_texture_size) { // This calculates top level Render Surface Layer List, and Layer List for all // Render Surfaces. @@ -447,9 +442,9 @@ // First compute an RSLL that might include surfaces that later turn out to // have an empty content rect. After surface content rects are computed, // produce a final RSLL that omits empty surfaces. - ComputeInitialRenderSurfaceLayerList( - layer_tree_impl, property_trees, &initial_render_surface_list, - can_render_to_separate_surface, use_layer_lists); + ComputeInitialRenderSurfaceLayerList(layer_tree_impl, property_trees, + &initial_render_surface_list, + can_render_to_separate_surface); ComputeSurfaceContentRects(layer_tree_impl, property_trees, &initial_render_surface_list, max_texture_size); ComputeListOfNonEmptySurfaces(layer_tree_impl, property_trees, @@ -556,7 +551,7 @@ CalculateRenderSurfaceLayerList( inputs->root_layer->layer_tree_impl(), inputs->property_trees, inputs->render_surface_layer_list, inputs->can_render_to_separate_surface, - inputs->use_layer_lists, inputs->max_texture_size); + inputs->max_texture_size); if (should_measure_property_tree_performance) { TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
diff --git a/cc/trees/layer_tree_host_common.h b/cc/trees/layer_tree_host_common.h index dd668caa..2dc7f18 100644 --- a/cc/trees/layer_tree_host_common.h +++ b/cc/trees/layer_tree_host_common.h
@@ -74,7 +74,6 @@ int max_texture_size, bool can_render_to_separate_surface, bool can_adjust_raster_scales, - bool use_layer_lists, LayerImplList* render_surface_layer_list, PropertyTrees* property_trees); @@ -91,7 +90,6 @@ int max_texture_size; bool can_render_to_separate_surface; bool can_adjust_raster_scales; - bool use_layer_lists; LayerImplList* render_surface_layer_list; PropertyTrees* property_trees; };
diff --git a/cc/trees/layer_tree_host_common_perftest.cc b/cc/trees/layer_tree_host_common_perftest.cc index 89946ee..e6de5ae3 100644 --- a/cc/trees/layer_tree_host_common_perftest.cc +++ b/cc/trees/layer_tree_host_common_perftest.cc
@@ -114,7 +114,6 @@ active_tree->elastic_overscroll()->Current(active_tree->IsActiveTree()), active_tree->OverscrollElasticityLayer(), max_texture_size, can_render_to_separate_surface, - false, // don't use layer lists for perf tests host_impl->settings().layer_transforms_should_scale_layer_contents, &update_list, active_tree->property_trees()); LayerTreeHostCommon::CalculateDrawProperties(&inputs);
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 098b7bd..97d189fc 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -707,27 +707,6 @@ std::move(swap_promise)); } -void LayerTreeHostImpl::TrackDamageForAllSurfaces( - const LayerImplList& render_surface_layer_list) { - // For now, we use damage tracking to compute a global scissor. To do this, we - // must compute all damage tracking before drawing anything, so that we know - // the root damage rect. The root damage rect is then used to scissor each - // surface. - size_t render_surface_layer_list_size = render_surface_layer_list.size(); - for (size_t i = 0; i < render_surface_layer_list_size; ++i) { - size_t surface_index = render_surface_layer_list_size - 1 - i; - LayerImpl* render_surface_layer = render_surface_layer_list[surface_index]; - RenderSurfaceImpl* render_surface = - render_surface_layer->GetRenderSurface(); - DCHECK(render_surface); - render_surface->damage_tracker()->UpdateDamageTrackingState( - render_surface->layer_list(), render_surface, - render_surface->SurfacePropertyChangedOnlyFromDescendant(), - render_surface->content_rect(), render_surface->MaskLayer(), - render_surface->Filters()); - } -} - void LayerTreeHostImpl::FrameData::AsValueInto( base::trace_event::TracedValue* value) const { value->SetBoolean("has_no_damage", has_no_damage); @@ -807,7 +786,12 @@ DCHECK(CanDraw()); DCHECK(!active_tree_->LayerListIsEmpty()); - TrackDamageForAllSurfaces(*frame->render_surface_layer_list); + // For now, we use damage tracking to compute a global scissor. To do this, we + // must compute all damage tracking before drawing anything, so that we know + // the root damage rect. The root damage rect is then used to scissor each + // surface. + DamageTracker::UpdateDamageTracking(active_tree_.get(), + active_tree_->RenderSurfaceLayerList()); // If the root render surface has no visible damage, then don't generate a // frame at all.
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 001e901e..26d68d3 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -664,9 +664,6 @@ bool AnimateScrollbars(base::TimeTicks monotonic_time); bool AnimateBrowserControls(base::TimeTicks monotonic_time); - void TrackDamageForAllSurfaces( - const LayerImplList& render_surface_layer_list); - void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); // This function should only be called from PrepareToDraw, as DidDrawAllLayers
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index f7f0304e..6ac6ecf 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc
@@ -1103,8 +1103,7 @@ OverscrollElasticityLayer(), resource_provider()->max_texture_size(), can_render_to_separate_surface, settings().layer_transforms_should_scale_layer_contents, - settings().use_layer_lists, &render_surface_layer_list_, - &property_trees_); + &render_surface_layer_list_, &property_trees_); LayerTreeHostCommon::CalculateDrawProperties(&inputs); if (const char* client_name = GetClientNameForMetrics()) { UMA_HISTOGRAM_COUNTS(
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc index 4d1ca75..280ecd0 100644 --- a/cc/trees/property_tree.cc +++ b/cc/trees/property_tree.cc
@@ -1012,6 +1012,20 @@ return EffectTree::kInvalidNodeId; } +int EffectTree::LowestCommonAncestorWithRenderSurface(int id_1, + int id_2) const { + DCHECK(GetRenderSurface(id_1)); + DCHECK(GetRenderSurface(id_2)); + while (id_1 != id_2) { + if (id_1 < id_2) + id_2 = Node(id_2)->target_id; + else + id_1 = Node(id_1)->target_id; + } + + return id_1; +} + void EffectTree::AddMaskLayerId(int id) { mask_layer_ids_.push_back(id); }
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h index de5cc28..52c90bcb 100644 --- a/cc/trees/property_tree.h +++ b/cc/trees/property_tree.h
@@ -380,6 +380,11 @@ int ClosestAncestorWithCopyRequest(int id) const; + // Given the ids of two effect nodes that have render surfaces, returns the + // id of the lowest common ancestor effect node that also has a render + // surface. + int LowestCommonAncestorWithRenderSurface(int id_1, int id_2) const; + void AddMaskLayerId(int id); const std::vector<int>& mask_layer_ids() const { return mask_layer_ids_; }
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index ee95c16c..96f07612 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -291,12 +291,10 @@ <activity android:name="org.chromium.chrome.browser.document.DocumentActivity" android:exported="false" android:theme="@style/MainTheme" - android:windowSoftInputMode="adjustResize" android:taskAffinity="" android:persistableMode="persistAcrossReboots" android:autoRemoveFromRecents="false" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - android:hardwareAccelerated="false"> + {{ self.chrome_activity_common() }}> </activity> <activity-alias android:name="com.google.android.apps.chrome.document.DocumentActivity" android:targetActivity="org.chromium.chrome.browser.document.DocumentActivity" @@ -305,12 +303,10 @@ android:icon="@mipmap/incognito_app_icon" android:exported="false" android:theme="@style/IncognitoTheme" - android:windowSoftInputMode="adjustResize" android:taskAffinity="" android:persistableMode="persistNever" android:autoRemoveFromRecents="false" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - android:hardwareAccelerated="false"> + {{ self.chrome_activity_common() }}> </activity> <activity-alias android:name="com.google.android.apps.chrome.document.IncognitoDocumentActivity" android:targetActivity="org.chromium.chrome.browser.document.IncognitoDocumentActivity" @@ -320,20 +316,16 @@ <activity android:name="org.chromium.chrome.browser.customtabs.CustomTabActivity" android:theme="@style/MainTheme" android:exported="false" - android:windowSoftInputMode="adjustResize" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - android:hardwareAccelerated="false" + {{ self.chrome_activity_common() }} {{ self.supports_video_persistence() }} > </activity> <activity android:name="org.chromium.chrome.browser.customtabs.SeparateTaskCustomTabActivity" android:theme="@style/MainTheme" android:exported="false" android:taskAffinity="" - android:windowSoftInputMode="adjustResize" android:persistableMode="persistNever" android:autoRemoveFromRecents="false" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - android:hardwareAccelerated="false" + {{ self.chrome_activity_common() }} {{ self.supports_video_persistence() }} > </activity> {% for i in range(10) %} @@ -342,11 +334,9 @@ android:icon="@mipmap/app_single_page_icon" android:exported="false" android:launchMode="singleTask" - android:windowSoftInputMode="adjustResize" android:persistableMode="persistNever" android:taskAffinity="" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - android:hardwareAccelerated="false" + {{ self.chrome_activity_common() }} {{ self.supports_video_persistence() }} > </activity> {% endfor %} @@ -355,33 +345,29 @@ <activity android:name="org.chromium.chrome.browser.ChromeTabbedActivity" android:theme="@style/TabbedModeTheme" android:exported="false" - android:windowSoftInputMode="adjustResize" android:launchMode="singleTask" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode" - android:hardwareAccelerated="false" {# We can only use blocks once in Jinja, for future substitutions we use self.supports_video_persistence(). #} {% block supports_video_persistence %} {% endblock %} + {% block chrome_activity_common %} + android:windowSoftInputMode="adjustResize" + android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode" + android:hardwareAccelerated="false" + {% endblock %} > </activity> <activity android:name="org.chromium.chrome.browser.ChromeTabbedActivity2" - android:theme="@style/TabbedModeTheme" - android:exported="false" - android:windowSoftInputMode="adjustResize" - android:taskAffinity="{{ manifest_package }}.ChromeTabbedActivity2" - android:launchMode="singleTask" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode" - android:hardwareAccelerated="false" - {{ self.supports_video_persistence() }} - > + android:theme="@style/TabbedModeTheme" + android:exported="false" + android:taskAffinity="{{ manifest_package }}.ChromeTabbedActivity2" + android:launchMode="singleTask" + {{ self.chrome_activity_common() }}> </activity> <activity android:name="org.chromium.chrome.browser.multiwindow.MultiInstanceChromeTabbedActivity" android:theme="@style/TabbedModeTheme" android:exported="false" - android:windowSoftInputMode="adjustResize" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode" - android:hardwareAccelerated="false"> + {{ self.chrome_activity_common() }}> </activity> <activity android:name="org.chromium.chrome.browser.sync.ui.PassphraseActivity" @@ -492,11 +478,9 @@ android:theme="@style/WebappTheme" android:label="@string/webapp_activity_title" android:documentLaunchMode="intoExisting" - android:windowSoftInputMode="adjustResize" android:persistableMode="persistNever" - android:hardwareAccelerated="false" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - {{ self.supports_video_persistence() }} > + {{ self.supports_video_persistence() }} + {{ self.chrome_activity_common() }}> </activity> <activity-alias android:name="com.google.android.apps.chrome.webapps.WebappActivity" android:targetActivity="org.chromium.chrome.browser.webapps.WebappActivity" @@ -509,12 +493,10 @@ android:icon="@mipmap/app_shortcut_icon" android:label="@string/webapp_activity_title" android:launchMode="singleTask" - android:windowSoftInputMode="adjustResize" android:persistableMode="persistNever" - android:hardwareAccelerated="false" android:taskAffinity="{{ manifest_package }}.webapps.WebappActivity{{ i }}" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - {{ self.supports_video_persistence() }} > + {{ self.supports_video_persistence() }} + {{ self.chrome_activity_common() }}> </activity> <activity-alias android:name="com.google.android.apps.chrome.webapps.WebappActivity{{ i }}" android:targetActivity="org.chromium.chrome.browser.webapps.WebappActivity{{ i }}" @@ -528,11 +510,9 @@ android:label="@string/webapp_activity_title" android:launchMode="singleTop" android:documentLaunchMode="intoExisting" - android:windowSoftInputMode="adjustResize" android:persistableMode="persistNever" - android:hardwareAccelerated="false" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - {{ self.supports_video_persistence() }} > + {{ self.supports_video_persistence() }} + {{ self.chrome_activity_common() }}> </activity> {% for i in range(10) %} <activity android:name="org.chromium.chrome.browser.webapps.WebApkActivity{{ i }}" @@ -540,12 +520,10 @@ android:icon="@mipmap/app_shortcut_icon" android:label="@string/webapp_activity_title" android:launchMode="singleTask" - android:windowSoftInputMode="adjustResize" android:persistableMode="persistNever" - android:hardwareAccelerated="false" android:taskAffinity="{{ manifest_package }}.webapps.WebApkActivity{{ i }}" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" - {{ self.supports_video_persistence() }} > + {{ self.supports_video_persistence() }} + {{ self.chrome_activity_common() }}> </activity> {% endfor %} @@ -701,7 +679,10 @@ <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <intent-filter> - <action android:name="org.chromium.chrome.browser.searchwidget.START_SEARCH_ACTIVITY" /> + <action android:name="org.chromium.chrome.browser.searchwidget.START_TEXT_QUERY" /> + </intent-filter> + <intent-filter> + <action android:name="org.chromium.chrome.browser.searchwidget.START_VOICE_QUERY" /> </intent-filter> <intent-filter> <action android:name="org.chromium.chrome.browser.searchwidget.UPDATE_ALL_WIDGETS" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java index 6b29a95..c27abfc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
@@ -15,7 +15,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; import org.chromium.base.annotations.SuppressFBWarnings; -import org.chromium.base.library_loader.LibraryLoader; +import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.chrome.browser.download.DownloadResumptionScheduler; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; @@ -27,6 +27,7 @@ import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.precache.PrecacheController; import org.chromium.chrome.browser.precache.PrecacheUMA; +import org.chromium.content.browser.BrowserStartupController; /** * {@link ChromeBackgroundService} is scheduled through the {@link GcmNetworkManager} when the @@ -145,7 +146,8 @@ private void handleOfflinePageBackgroundLoad( Context context, Bundle bundle, ChromeBackgroundServiceWaiter waiter, String tag) { - if (!LibraryLoader.isInitialized()) { + if (!BrowserStartupController.get(LibraryProcessType.PROCESS_BROWSER) + .isStartupSuccessfullyCompleted()) { launchBrowser(context, tag); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflineBackgroundTask.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflineBackgroundTask.java index 938e644..b53aa4ae 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflineBackgroundTask.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflineBackgroundTask.java
@@ -8,7 +8,7 @@ import org.chromium.base.Callback; import org.chromium.base.Log; -import org.chromium.base.library_loader.LibraryLoader; +import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.offlinepages.interfaces.BackgroundSchedulerProcessor; @@ -16,6 +16,7 @@ import org.chromium.components.background_task_scheduler.BackgroundTask.TaskFinishedCallback; import org.chromium.components.background_task_scheduler.TaskIds; import org.chromium.components.background_task_scheduler.TaskParameters; +import org.chromium.content.browser.BrowserStartupController; /** * Handles servicing background offlining requests coming via background_task_scheduler component. @@ -57,7 +58,10 @@ } private static void launchBrowserIfNecessary(Context context) { - if (LibraryLoader.isInitialized()) return; + if (BrowserStartupController.get(LibraryProcessType.PROCESS_BROWSER) + .isStartupSuccessfullyCompleted()) { + return; + } // TODO(fgorski): This method is taken from ChromeBackgroundService as a local fix and will // be removed with BackgroundTaskScheduler supporting GcmNetworkManager scheduling.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java index bdea5fed..be135f5e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java
@@ -45,7 +45,8 @@ public static final int ACTION_MAIN_MENU_OFF_TO_ON = 17; public static final int ACTION_MAIN_MENU_ON_TO_OFF = 18; public static final int ACTION_MAIN_MENU_ON_TO_ON = 19; - public static final int ACTION_INDEX_BOUNDARY = 20; + public static final int ACTION_STATS_RESET = 20; + public static final int ACTION_INDEX_BOUNDARY = 21; // Represent the possible Lo-Fi context menu user actions. This must remain in sync with // Previews.ContextMenuAction.LoFi in tools/metrics/histograms/histograms.xml.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionStatsPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionStatsPreference.java index 77cfb84..52fb8ee 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionStatsPreference.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionStatsPreference.java
@@ -181,6 +181,8 @@ updateReductionStatistics(); setDetailText(); notifyChanged(); + DataReductionProxyUma.dataReductionProxyUIAction( + DataReductionProxyUma.ACTION_STATS_RESET); } }); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java index 84d23c9b..3189f7c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
@@ -13,6 +13,7 @@ import android.view.View; import android.view.ViewGroup; +import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.WebContentsFactory; @@ -36,6 +37,8 @@ public class SearchActivity extends AsyncInitializationActivity implements SnackbarManageable, SearchActivityLocationBarLayout.Delegate, View.OnLayoutChangeListener { + /** Setting this field causes the Activity to finish itself immediately for tests. */ + private static boolean sIsDisabledForTest; /** Main content view. */ private ViewGroup mContentView; @@ -54,6 +57,12 @@ private Tab mTab; @Override + protected boolean isStartedUpCorrectly(Intent intent) { + if (sIsDisabledForTest) return false; + return true; + } + + @Override public void backKeyPressed() { cancelSearch(); } @@ -219,4 +228,10 @@ finish(); overridePendingTransition(0, R.anim.activity_close_exit); } + + /** See {@link #sIsDisabledForTest}. */ + @VisibleForTesting + static void disableForTests() { + sIsDisabledForTest = true; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java index e3a01fd..8116977b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java
@@ -21,20 +21,57 @@ import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.ThreadUtils; +import org.chromium.base.VisibleForTesting; import org.chromium.base.library_loader.LibraryLoader; import org.chromium.chrome.R; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.search_engines.TemplateUrlService; import org.chromium.chrome.browser.search_engines.TemplateUrlService.LoadListener; import org.chromium.chrome.browser.search_engines.TemplateUrlService.TemplateUrlServiceObserver; +import org.chromium.chrome.browser.util.IntentUtils; /** * Widget that lets the user search using their default search engine. * * Because this is a BroadcastReceiver, it dies immediately after it runs. A new one is created * for each new broadcast. + * + * This class avoids loading the native library because it can be triggered at regular intervals by + * Android when it tells widgets that they need updates. */ public class SearchWidgetProvider extends AppWidgetProvider { + /** Wraps up all things that a {@link SearchWidgetProvider} can request things from. */ + static class SearchWidgetProviderDelegate { + private final Context mContext; + private final AppWidgetManager mManager; + + public SearchWidgetProviderDelegate(Context context) { + mContext = context == null ? ContextUtils.getApplicationContext() : context; + mManager = AppWidgetManager.getInstance(mContext); + } + + /** Returns the Context to pull resources from. */ + protected Context getContext() { + return mContext; + } + + /** See {@link ContextUtils#getAppSharedPreferences}. */ + protected SharedPreferences getSharedPreferences() { + return ContextUtils.getAppSharedPreferences(); + } + + /** Returns IDs for all search widgets that exist. */ + protected int[] getAllSearchWidgetIds() { + return mManager.getAppWidgetIds( + new ComponentName(getContext(), SearchWidgetProvider.class.getName())); + } + + /** See {@link AppWidgetManager#updateAppWidget}. */ + protected void updateAppWidget(int id, RemoteViews views) { + mManager.updateAppWidget(id, views); + } + } + /** Monitors the TemplateUrlService for changes, updating the widget when necessary. */ private static final class SearchWidgetTemplateUrlServiceObserver implements LoadListener, TemplateUrlServiceObserver { @@ -48,13 +85,24 @@ public void onTemplateURLServiceChanged() { updateCachedEngineName(); } + + private void updateCachedEngineName() { + assert LibraryLoader.isInitialized(); + + // Getting an instance of the TemplateUrlService requires that the native library be + // loaded, but the TemplateUrlService also itself needs to be initialized. + TemplateUrlService service = TemplateUrlService.getInstance(); + assert service.isLoaded(); + SearchWidgetProvider.updateCachedEngineName( + service.getDefaultSearchEngineTemplateUrl().getShortName()); + } } - private static final String ACTION_START_TEXT_QUERY = + static final String ACTION_START_TEXT_QUERY = "org.chromium.chrome.browser.searchwidget.START_TEXT_QUERY"; - private static final String ACTION_START_VOICE_QUERY = + static final String ACTION_START_VOICE_QUERY = "org.chromium.chrome.browser.searchwidget.START_VOICE_QUERY"; - private static final String ACTION_UPDATE_ALL_WIDGETS = + static final String ACTION_UPDATE_ALL_WIDGETS = "org.chromium.chrome.browser.searchwidget.UPDATE_ALL_WIDGETS"; static final String EXTRA_START_VOICE_SEARCH = @@ -66,9 +114,11 @@ "org.chromium.chrome.browser.searchwidget.SEARCH_ENGINE_SHORTNAME"; private static final String TAG = "searchwidget"; + private static final Object DELEGATE_LOCK = new Object(); private static final Object OBSERVER_LOCK = new Object(); private static SearchWidgetTemplateUrlServiceObserver sObserver; + private static SearchWidgetProviderDelegate sDelegate; /** * Creates the singleton instance of the observer that will monitor for search engine changes. @@ -92,30 +142,45 @@ /** Nukes all cached information and forces all widgets to start with a blank slate. */ public static void reset() { - SharedPreferences.Editor editor = ContextUtils.getAppSharedPreferences().edit(); + SharedPreferences.Editor editor = getDelegate().getSharedPreferences().edit(); editor.remove(PREF_IS_VOICE_SEARCH_AVAILABLE); editor.remove(PREF_SEARCH_ENGINE_SHORTNAME); editor.apply(); - updateAllWidgets(); + + performUpdate(null); } @Override public void onReceive(Context context, Intent intent) { if (IntentHandler.isIntentChromeOrFirstParty(intent)) { - if (ACTION_START_TEXT_QUERY.equals(intent.getAction())) { - startSearchActivity(context, false); - } else if (ACTION_START_VOICE_QUERY.equals(intent.getAction())) { - startSearchActivity(context, true); - } else if (ACTION_UPDATE_ALL_WIDGETS.equals(intent.getAction())) { - performUpdate(context); - } - return; + handleAction(intent.getAction()); + } else { + super.onReceive(context, intent); } - super.onReceive(context, intent); } - private void startSearchActivity(Context context, boolean startVoiceSearch) { + @Override + public void onUpdate(Context context, AppWidgetManager manager, int[] ids) { + performUpdate(ids); + } + + /** Handles the intent actions to the widget. */ + @VisibleForTesting + static void handleAction(String action) { + if (ACTION_START_TEXT_QUERY.equals(action)) { + startSearchActivity(false); + } else if (ACTION_START_VOICE_QUERY.equals(action)) { + startSearchActivity(true); + } else if (ACTION_UPDATE_ALL_WIDGETS.equals(action)) { + performUpdate(null); + } else { + assert false; + } + } + + private static void startSearchActivity(boolean startVoiceSearch) { Log.d(TAG, "Launching SearchActivity: VOICE=" + startVoiceSearch); + Context context = getDelegate().getContext(); // Launch the SearchActivity. Intent searchIntent = new Intent(); @@ -127,30 +192,23 @@ Bundle optionsBundle = ActivityOptionsCompat.makeCustomAnimation(context, R.anim.activity_open_enter, 0) .toBundle(); - context.startActivity(searchIntent, optionsBundle); + IntentUtils.safeStartActivity(context, searchIntent, optionsBundle); } - @Override - public void onUpdate(Context context, AppWidgetManager manager, int[] ids) { - performUpdate(context, ids); - } + private static void performUpdate(int[] ids) { + SearchWidgetProviderDelegate delegate = getDelegate(); - private static void performUpdate(Context context) { - AppWidgetManager manager = AppWidgetManager.getInstance(context); - performUpdate(context, getAllSearchWidgetIds(manager)); - } - - private static void performUpdate(Context context, int[] ids) { + if (ids == null) ids = delegate.getAllSearchWidgetIds(); if (ids.length == 0) return; - AppWidgetManager manager = AppWidgetManager.getInstance(context); - SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); - boolean isVoiceSearchAvailable = prefs.getBoolean(PREF_IS_VOICE_SEARCH_AVAILABLE, true); - String engineName = prefs.getString(PREF_SEARCH_ENGINE_SHORTNAME, null); + SharedPreferences prefs = delegate.getSharedPreferences(); + boolean isVoiceSearchAvailable = getCachedVoiceSearchAvailability(prefs); + String engineName = getCachedEngineName(prefs); for (int id : ids) { - RemoteViews views = createWidgetViews(context, id, engineName, isVoiceSearchAvailable); - manager.updateAppWidget(id, views); + RemoteViews views = createWidgetViews( + delegate.getContext(), id, engineName, isVoiceSearchAvailable); + delegate.updateAppWidget(id, views); } } @@ -188,10 +246,10 @@ /** Caches whether or not a voice search is possible. */ static void updateCachedVoiceSearchAvailability(boolean isVoiceSearchAvailable) { - SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); - if (prefs.getBoolean(PREF_IS_VOICE_SEARCH_AVAILABLE, true) != isVoiceSearchAvailable) { + SharedPreferences prefs = getDelegate().getSharedPreferences(); + if (getCachedVoiceSearchAvailability(prefs) != isVoiceSearchAvailable) { prefs.edit().putBoolean(PREF_IS_VOICE_SEARCH_AVAILABLE, isVoiceSearchAvailable).apply(); - updateAllWidgets(); + performUpdate(null); } } @@ -200,28 +258,14 @@ * Caching it in SharedPreferences prevents us from having to load the native library and the * TemplateUrlService whenever the widget is updated. */ - private static void updateCachedEngineName() { - assert LibraryLoader.isInitialized(); - - // Getting an instance of the TemplateUrlService requires that the native library be - // loaded, but the TemplateUrlService itself needs to be initialized. - TemplateUrlService service = TemplateUrlService.getInstance(); - assert service.isLoaded(); - String engineName = service.getDefaultSearchEngineTemplateUrl().getShortName(); - - SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); - if (!TextUtils.equals(prefs.getString(PREF_SEARCH_ENGINE_SHORTNAME, null), engineName)) { + static void updateCachedEngineName(String engineName) { + SharedPreferences prefs = getDelegate().getSharedPreferences(); + if (!TextUtils.equals(getCachedEngineName(prefs), engineName)) { prefs.edit().putString(PREF_SEARCH_ENGINE_SHORTNAME, engineName).apply(); - updateAllWidgets(); + performUpdate(null); } } - /** Get the IDs of all existing search widgets. */ - private static int[] getAllSearchWidgetIds(AppWidgetManager manager) { - return manager.getAppWidgetIds(new ComponentName( - ContextUtils.getApplicationContext(), SearchWidgetProvider.class.getName())); - } - /** Creates a trusted Intent that lets the user begin performing queries. */ private static Intent createStartQueryIntent(Context context, String action, int widgetId) { Intent intent = new Intent(action, Uri.parse(String.valueOf(widgetId))); @@ -230,8 +274,25 @@ return intent; } - /** Immediately updates all widgets. */ - private static void updateAllWidgets() { - performUpdate(ContextUtils.getApplicationContext()); + /** Sets an {@link SearchWidgetProviderDelegate} to interact with. */ + @VisibleForTesting + static void setDelegateForTest(SearchWidgetProviderDelegate delegate) { + assert sDelegate == null; + sDelegate = delegate; + } + + private static boolean getCachedVoiceSearchAvailability(SharedPreferences prefs) { + return prefs.getBoolean(PREF_IS_VOICE_SEARCH_AVAILABLE, true); + } + + private static String getCachedEngineName(SharedPreferences prefs) { + return prefs.getString(PREF_SEARCH_ENGINE_SHORTNAME, null); + } + + private static SearchWidgetProviderDelegate getDelegate() { + synchronized (DELEGATE_LOCK) { + if (sDelegate == null) sDelegate = new SearchWidgetProviderDelegate(null); + } + return sDelegate; } }
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index dd854d7..cb5733cf 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -1535,6 +1535,7 @@ "javatests/src/org/chromium/chrome/browser/provider/ProviderTestBase.java", "javatests/src/org/chromium/chrome/browser/push_messaging/PushMessagingTest.java", "javatests/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceTest.java", + "javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java", "javatests/src/org/chromium/chrome/browser/services/GoogleServicesManagerIntegrationTest.java", "javatests/src/org/chromium/chrome/browser/shape_detection/ShapeDetectionTest.java", "javatests/src/org/chromium/chrome/browser/share/ShareUrlTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java new file mode 100644 index 0000000..4f7f6a6 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProviderTest.java
@@ -0,0 +1,188 @@ +// Copyright 2017 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. + +package org.chromium.chrome.browser.searchwidget; + +import android.app.Activity; +import android.app.Instrumentation; +import android.app.Instrumentation.ActivityMonitor; +import android.content.Context; +import android.content.Intent; +import android.support.test.InstrumentationRegistry; +import android.support.test.filters.SmallTest; +import android.util.Pair; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.RemoteViews; +import android.widget.TextView; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.ContextUtils; +import org.chromium.base.ThreadUtils; +import org.chromium.base.test.util.AdvancedMockContext; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.util.IntentUtils; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; + +import java.util.ArrayList; +import java.util.List; + +/** + * Tests for the SearchWidgetProvider. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +public class SearchWidgetProviderTest { + private static final class TestDelegate + extends SearchWidgetProvider.SearchWidgetProviderDelegate { + public static final int[] ALL_IDS = {11684, 20170525}; + + public final List<Pair<Integer, RemoteViews>> mViews = new ArrayList<>(); + + private TestDelegate(Context context) { + super(context); + } + + @Override + protected int[] getAllSearchWidgetIds() { + return ALL_IDS; + } + + @Override + protected void updateAppWidget(int id, RemoteViews views) { + mViews.add(new Pair<Integer, RemoteViews>(id, views)); + } + } + + private static final class TestContext extends AdvancedMockContext { + public TestContext() { + // Wrapping the application context allows the ContextUtils to avoid writing to the real + // SharedPreferences file. + super(InstrumentationRegistry.getInstrumentation() + .getTargetContext() + .getApplicationContext()); + } + } + + private static final String TEXT_GENERIC = "Search"; + private static final String TEXT_SEARCH_ENGINE = "Stuff and Thangs"; + private static final String TEXT_SEARCH_ENGINE_FULL = "Search with Stuff and Thangs"; + + private TestContext mContext; + private TestDelegate mDelegate; + + @Before + public void setUp() throws Exception { + SearchActivity.disableForTests(); + + mContext = new TestContext(); + ContextUtils.initApplicationContextForTests(mContext); + + mDelegate = new TestDelegate(mContext); + SearchWidgetProvider.setDelegateForTest(mDelegate); + } + + @Test + @SmallTest + public void testUpdateAll() { + SearchWidgetProvider.handleAction(SearchWidgetProvider.ACTION_UPDATE_ALL_WIDGETS); + + // Without any idea of what the default search engine is, widgets should default to saying + // just "Search". + checkWidgetStates(TEXT_GENERIC, View.VISIBLE); + + // The microphone icon should disappear if voice queries are unavailable. + mDelegate.mViews.clear(); + SearchWidgetProvider.updateCachedVoiceSearchAvailability(false); + checkWidgetStates(TEXT_GENERIC, View.GONE); + + // After recording that the default search engine is "X", it should say "Search with X". + mDelegate.mViews.clear(); + SearchWidgetProvider.updateCachedEngineName(TEXT_SEARCH_ENGINE); + checkWidgetStates(TEXT_SEARCH_ENGINE_FULL, View.GONE); + + // The microphone icon should appear if voice queries are available. + mDelegate.mViews.clear(); + SearchWidgetProvider.updateCachedVoiceSearchAvailability(true); + checkWidgetStates(TEXT_SEARCH_ENGINE_FULL, View.VISIBLE); + } + + private void checkWidgetStates(final String expectedString, final int expectedMicrophoneState) { + // Confirm that all the widgets got updated. + Assert.assertEquals(TestDelegate.ALL_IDS.length, mDelegate.mViews.size()); + for (int i = 0; i < TestDelegate.ALL_IDS.length; i++) { + Assert.assertEquals(TestDelegate.ALL_IDS[i], mDelegate.mViews.get(i).first.intValue()); + } + + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + // Check the contents of the RemoteViews by inflating them. + for (int i = 0; i < mDelegate.mViews.size(); i++) { + FrameLayout parentView = new FrameLayout(mContext); + RemoteViews views = mDelegate.mViews.get(i).second; + View view = views.apply(mContext, parentView); + parentView.addView(view); + + // Confirm that the string is correct. + TextView titleView = (TextView) view.findViewById(R.id.title); + Assert.assertEquals(View.VISIBLE, titleView.getVisibility()); + Assert.assertEquals(expectedString, titleView.getText()); + + // Confirm the visibility of the microphone. + View microphoneView = view.findViewById(R.id.microphone_icon); + Assert.assertEquals(expectedMicrophoneState, microphoneView.getVisibility()); + } + } + }); + } + + @Test + @SmallTest + public void testMicrophoneClick() { + SearchWidgetProvider.handleAction(SearchWidgetProvider.ACTION_UPDATE_ALL_WIDGETS); + for (int i = 0; i < mDelegate.mViews.size(); i++) { + RemoteViews views = mDelegate.mViews.get(i).second; + clickOnWidget(views, R.id.microphone_icon); + } + } + + @Test + @SmallTest + public void testTextClick() { + SearchWidgetProvider.handleAction(SearchWidgetProvider.ACTION_UPDATE_ALL_WIDGETS); + for (int i = 0; i < mDelegate.mViews.size(); i++) { + RemoteViews views = mDelegate.mViews.get(i).second; + clickOnWidget(views, R.id.text_container); + } + } + + private void clickOnWidget(final RemoteViews views, final int clickTarget) { + final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation(); + final ActivityMonitor monitor = + new ActivityMonitor(SearchActivity.class.getName(), null, false); + instrumentation.addMonitor(monitor); + + // Click on the widget. + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + FrameLayout parentView = new FrameLayout(mContext); + View view = views.apply(mContext, parentView); + parentView.addView(view); + view.findViewById(clickTarget).performClick(); + } + }); + + // Check that the Activity was launched in the right mode. + Activity activity = instrumentation.waitForMonitor(monitor); + Intent intent = activity.getIntent(); + boolean microphoneState = IntentUtils.safeGetBooleanExtra( + intent, SearchWidgetProvider.EXTRA_START_VOICE_SEARCH, false); + Assert.assertEquals(clickTarget == R.id.microphone_icon, microphoneState); + } +}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index cda77e2..f163dbf 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1453,6 +1453,7 @@ "//components/captive_portal", "//components/certificate_reporting", "//components/certificate_transparency", + "//components/chrome_cleaner/public/constants", "//components/chrome_cleaner/public/interfaces", "//components/cloud_devices/common", "//components/component_updater",
diff --git a/chrome/browser/android/offline_pages/background_loader_offliner.cc b/chrome/browser/android/offline_pages/background_loader_offliner.cc index 60f8c50..3ff7ad6e 100644 --- a/chrome/browser/android/offline_pages/background_loader_offliner.cc +++ b/chrome/browser/android/offline_pages/background_loader_offliner.cc
@@ -78,6 +78,8 @@ page_load_state_(SUCCESS), page_delay_ms_(kOfflinePageDelayMs), network_bytes_(0LL), + is_low_bar_met_(false), + did_snapshot_on_last_retry_(false), weak_ptr_factory_(this) { DCHECK(offline_page_model_); DCHECK(browser_context_);
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.cc b/chrome/browser/android/offline_pages/prerendering_loader.cc index 680d7be..df12f0b88 100644 --- a/chrome/browser/android/offline_pages/prerendering_loader.cc +++ b/chrome/browser/android/offline_pages/prerendering_loader.cc
@@ -94,12 +94,10 @@ } void PrerenderingLoader::AddLoadingSignal(const char* signal_name) { - std::string signal(signal_name); - signal += ": "; base::TimeTicks current_time = base::TimeTicks::Now(); base::TimeDelta delay_so_far = current_time - load_start_time_; - signal += std::to_string(delay_so_far.InMilliseconds()); - signal_data_.push_back(signal); + double delay = delay_so_far.InMilliseconds(); + signal_data_.SetDouble(signal_name, delay); } bool PrerenderingLoader::LoadPage(const GURL& url,
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.h b/chrome/browser/android/offline_pages/prerendering_loader.h index 5733fec..a3ed68c 100644 --- a/chrome/browser/android/offline_pages/prerendering_loader.h +++ b/chrome/browser/android/offline_pages/prerendering_loader.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/callback.h" +#include "base/values.h" #include "chrome/browser/android/offline_pages/prerender_adapter.h" #include "components/offline_pages/core/background/offliner.h" #include "components/offline_pages/core/snapshot_controller.h" @@ -84,10 +85,8 @@ // Returns true if the lowbar of snapshotting a page is met. virtual bool IsLowbarMet(); - // Returns a vector of strings for analysis of loading progress. - const std::vector<std::string>& GetLoadingSignalData() { - return signal_data_; - } + // Returns a JSON dictionary value for analysis of loading progress. + const base::DictionaryValue& GetLoadingSignalData() { return signal_data_; } private: // State of the loader (only one request may be active at a time). @@ -134,7 +133,7 @@ std::unique_ptr<content::WebContents> session_contents_; // Signal data collected for this rendering attempt - std::vector<std::string> signal_data_; + base::DictionaryValue signal_data_; // Callback to call when the active load request completes, fails, or is // canceled.
diff --git a/chrome/browser/android/offline_pages/prerendering_offliner.cc b/chrome/browser/android/offline_pages/prerendering_offliner.cc index 7e0220c..45bf01d7f 100644 --- a/chrome/browser/android/offline_pages/prerendering_offliner.cc +++ b/chrome/browser/android/offline_pages/prerendering_offliner.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/android/offline_pages/prerendering_offliner.h" #include "base/bind.h" +#include "base/json/json_writer.h" #include "base/metrics/histogram_macros.h" #include "base/sys_info.h" #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" @@ -125,13 +126,10 @@ std::string PrerenderingOffliner::SerializeLoadingSignalData() { // Write the signal data into a single string. std::string signal_string; - const std::vector<std::string>& signals = loader_->GetLoadingSignalData(); + const base::DictionaryValue& signals = loader_->GetLoadingSignalData(); - // TODO(petewil): Convert this to JSON, use json_writer.h - for (std::string signal : signals) { - signal_string += signal; - signal_string += "\n"; - } + base::JSONWriter::Write(signals, &signal_string); + return signal_string; }
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 08043d25..3dd6bb3 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc
@@ -298,25 +298,16 @@ return; if (type == WINDOW_CLOSE) { - // TODO(manzagop): turn down recording in M57 (once trendlines overlap). - UMA_HISTOGRAM_TIMES("Shutdown.window_close.time", - TimeDelta::FromMilliseconds(shutdown_ms)); UMA_HISTOGRAM_MEDIUM_TIMES("Shutdown.window_close.time2", TimeDelta::FromMilliseconds(shutdown_ms)); UMA_HISTOGRAM_TIMES("Shutdown.window_close.time_per_process", TimeDelta::FromMilliseconds(shutdown_ms / num_procs)); } else if (type == BROWSER_EXIT) { - // TODO(manzagop): turn down recording in M57 (once trendlines overlap). - UMA_HISTOGRAM_TIMES("Shutdown.browser_exit.time", - TimeDelta::FromMilliseconds(shutdown_ms)); UMA_HISTOGRAM_MEDIUM_TIMES("Shutdown.browser_exit.time2", TimeDelta::FromMilliseconds(shutdown_ms)); UMA_HISTOGRAM_TIMES("Shutdown.browser_exit.time_per_process", TimeDelta::FromMilliseconds(shutdown_ms / num_procs)); } else if (type == END_SESSION) { - // TODO(manzagop): turn down recording in M57 (once trendlines overlap). - UMA_HISTOGRAM_TIMES("Shutdown.end_session.time", - TimeDelta::FromMilliseconds(shutdown_ms)); UMA_HISTOGRAM_MEDIUM_TIMES("Shutdown.end_session.time2", TimeDelta::FromMilliseconds(shutdown_ms)); UMA_HISTOGRAM_TIMES("Shutdown.end_session.time_per_process",
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 9679ace6..1b36190 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -485,8 +485,19 @@ #endif enum AppLoadedInTabSource { + // A platform app page tried to load one of its own URLs in a tab. APP_LOADED_IN_TAB_SOURCE_APP = 0, + + // A platform app background page tried to load one of its own URLs in a tab. APP_LOADED_IN_TAB_SOURCE_BACKGROUND_PAGE, + + // An extension or app tried to load a resource of a different platform app in + // a tab. + APP_LOADED_IN_TAB_SOURCE_OTHER_EXTENSION, + + // A non-app and non-extension page tried to load a platform app in a tab. + APP_LOADED_IN_TAB_SOURCE_OTHER, + APP_LOADED_IN_TAB_SOURCE_MAX }; @@ -890,6 +901,28 @@ std::string(), incognito)); } + +AppLoadedInTabSource ClassifyAppLoadedInTabSource( + const GURL& opener_url, + const extensions::Extension* target_platform_app) { + if (opener_url.SchemeIs(extensions::kExtensionScheme)) { + if (opener_url.host_piece() == target_platform_app->id()) { + // This platform app was trying to window.open() one of its own URLs. + if (opener_url == + extensions::BackgroundInfo::GetBackgroundURL(target_platform_app)) { + // Source was the background page. + return APP_LOADED_IN_TAB_SOURCE_BACKGROUND_PAGE; + } else { + // Source was a different page inside the app. + return APP_LOADED_IN_TAB_SOURCE_APP; + } + } + // The forbidden app URL was being opened by a different app or extension. + return APP_LOADED_IN_TAB_SOURCE_OTHER_EXTENSION; + } + // The forbidden app URL was being opened by a non-extension page (e.g. http). + return APP_LOADED_IN_TAB_SOURCE_OTHER; +} #endif // BUILDFLAG(ENABLE_EXTENSIONS) void CreateUsbDeviceManager( @@ -2489,20 +2522,14 @@ ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); InfoMap* map = io_data->GetExtensionInfoMap(); const Extension* extension = - map->extensions().GetExtensionOrAppByURL(opener_url); + map->extensions().GetExtensionOrAppByURL(target_url); if (extension && extension->is_platform_app()) { - AppLoadedInTabSource source = - opener_top_level_frame_url == - extensions::BackgroundInfo::GetBackgroundURL(extension) - ? APP_LOADED_IN_TAB_SOURCE_BACKGROUND_PAGE - : APP_LOADED_IN_TAB_SOURCE_APP; - // TODO(lazyboy): Remove this UMA once the change below to disallow apps - // in tabs has settled in stable branch. - UMA_HISTOGRAM_ENUMERATION("Extensions.AppLoadedInTab", source, - APP_LOADED_IN_TAB_SOURCE_MAX); - // Platform apps and their background pages should not be able to call - // window.open() to load v2 apps in regular tab. - // Simply disallow window.open() calls in this case. + UMA_HISTOGRAM_ENUMERATION( + "Extensions.AppLoadedInTab", + ClassifyAppLoadedInTabSource(opener_url, extension), + APP_LOADED_IN_TAB_SOURCE_MAX); + + // window.open() may not be used to load v2 apps in a regular tab. return false; } }
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index ae06f01..802f259 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -242,8 +242,11 @@ DBusThreadManager::Get()->GetPowerManagerClient()); CrosDBusService::ServiceProviderList service_providers; + // TODO(derat): Remove this provider once all callers are using + // |proxy_resolution_service_| instead: http://crbug.com/703217 service_providers.push_back( base::MakeUnique<ProxyResolutionServiceProvider>( + kLibCrosServiceInterface, kResolveNetworkProxy, base::MakeUnique<ChromeProxyResolutionServiceProviderDelegate>())); if (GetAshConfig() == ash::Config::CLASSIC) { // TODO(crbug.com/629707): revisit this with mustash dbus work. @@ -259,6 +262,8 @@ service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( base::MakeUnique<MusConsoleServiceProviderDelegate>())); } + // TODO(teravest): Remove this provider once all callers are using + // |kiosk_info_service_| instead: http://crbug.com/703229 service_providers.push_back(base::MakeUnique<KioskInfoService>( kLibCrosServiceInterface, kKioskAppServiceGetRequiredPlatformVersionMethod)); @@ -266,6 +271,15 @@ kLibCrosServiceName, dbus::ObjectPath(kLibCrosServicePath), std::move(service_providers)); + proxy_resolution_service_ = CrosDBusService::Create( + kNetworkProxyServiceName, dbus::ObjectPath(kNetworkProxyServicePath), + CrosDBusService::CreateServiceProviderList( + base::MakeUnique<ProxyResolutionServiceProvider>( + kNetworkProxyServiceInterface, + kNetworkProxyServiceResolveProxyMethod, + base::MakeUnique< + ChromeProxyResolutionServiceProviderDelegate>()))); + kiosk_info_service_ = CrosDBusService::Create( kKioskAppServiceName, dbus::ObjectPath(kKioskAppServicePath), CrosDBusService::CreateServiceProviderList( @@ -322,6 +336,7 @@ CertLoader::Shutdown(); TPMTokenLoader::Shutdown(); cros_dbus_service_.reset(); + proxy_resolution_service_.reset(); kiosk_info_service_.reset(); PowerDataCollector::Shutdown(); PowerPolicyController::Shutdown(); @@ -340,6 +355,7 @@ // split between different processes: http://crbug.com/692246 std::unique_ptr<CrosDBusService> cros_dbus_service_; + std::unique_ptr<CrosDBusService> proxy_resolution_service_; std::unique_ptr<CrosDBusService> kiosk_info_service_; std::unique_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_;
diff --git a/chrome/browser/chromeos/preferences_chromeos_browsertest.cc b/chrome/browser/chromeos/preferences_chromeos_browsertest.cc index fe2654d..0ddfaf85 100644 --- a/chrome/browser/chromeos/preferences_chromeos_browsertest.cc +++ b/chrome/browser/chromeos/preferences_chromeos_browsertest.cc
@@ -246,23 +246,27 @@ // Check that changing prefs of the active user doesn't affect prefs of the // inactive user. std::unique_ptr<base::DictionaryValue> prefs_backup = - prefs1->GetPreferenceValues(); + prefs1->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS); SetPrefs(prefs2, false); CheckSettingsCorrespondToPrefs(prefs2); - EXPECT_TRUE(prefs_backup->Equals(prefs1->GetPreferenceValues().get())); + EXPECT_TRUE(prefs_backup->Equals( + prefs1->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS).get())); SetPrefs(prefs2, true); CheckSettingsCorrespondToPrefs(prefs2); - EXPECT_TRUE(prefs_backup->Equals(prefs1->GetPreferenceValues().get())); + EXPECT_TRUE(prefs_backup->Equals( + prefs1->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS).get())); // Check that changing prefs of the inactive user doesn't affect prefs of the // active user. - prefs_backup = prefs2->GetPreferenceValues(); + prefs_backup = prefs2->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS); SetPrefs(prefs1, true); CheckSettingsCorrespondToPrefs(prefs2); - EXPECT_TRUE(prefs_backup->Equals(prefs2->GetPreferenceValues().get())); + EXPECT_TRUE(prefs_backup->Equals( + prefs2->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS).get())); SetPrefs(prefs1, false); CheckSettingsCorrespondToPrefs(prefs2); - EXPECT_TRUE(prefs_backup->Equals(prefs2->GetPreferenceValues().get())); + EXPECT_TRUE(prefs_backup->Equals( + prefs2->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS).get())); // Check that changing non-owner prefs doesn't change corresponding local // state prefs and vice versa.
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.cc b/chrome/browser/component_updater/sw_reporter_installer_win.cc index bca424f8..c15810b 100644 --- a/chrome/browser/component_updater/sw_reporter_installer_win.cc +++ b/chrome/browser/component_updater/sw_reporter_installer_win.cc
@@ -36,6 +36,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/safe_browsing/srt_fetcher_win.h" #include "chrome/browser/safe_browsing/srt_field_trial_win.h" +#include "components/chrome_cleaner/public/constants/constants.h" #include "components/component_updater/component_updater_paths.h" #include "components/component_updater/component_updater_service.h" #include "components/component_updater/pref_names.h" @@ -72,14 +73,6 @@ const base::FilePath::CharType kSwReporterExeName[] = FILE_PATH_LITERAL("software_reporter_tool.exe"); -constexpr char kSessionIdSwitch[] = "session-id"; - -// SRT registry keys and value names. -const wchar_t kCleanerSuffixRegistryKey[] = L"Cleaner"; -const wchar_t kExitCodeValueName[] = L"ExitCode"; -const wchar_t kUploadResultsValueName[] = L"UploadResults"; -const wchar_t kVersionValueName[] = L"Version"; - constexpr base::Feature kExperimentalEngineFeature{ "ExperimentalSwReporterEngine", base::FEATURE_DISABLED_BY_DEFAULT}; constexpr base::Feature kExperimentalEngineAllArchsFeature{ @@ -251,7 +244,8 @@ base::CommandLine command_line(argv); // Add a random session id to link experimental reporter runs together. - command_line.AppendSwitchASCII(kSessionIdSwitch, session_id); + command_line.AppendSwitchASCII(chrome_cleaner::kSessionIdSwitch, + session_id); const std::string experiment_group = variations::GetVariationParamValueByFeature( @@ -330,7 +324,8 @@ reporter_runner_); } else { base::CommandLine command_line(exe_path); - command_line.AppendSwitchASCII(kSessionIdSwitch, GenerateSessionId()); + command_line.AppendSwitchASCII(chrome_cleaner::kSessionIdSwitch, + GenerateSessionId()); auto invocation = SwReporterInvocation::FromCommandLine(command_line); invocation.supported_behaviours = SwReporterInvocation::BEHAVIOUR_LOG_EXIT_CODE_TO_PREFS | @@ -397,34 +392,34 @@ // Check if we have information from Cleaner and record UMA statistics. base::string16 cleaner_key_name( - safe_browsing::kSoftwareRemovalToolRegistryKey); - cleaner_key_name.append(1, L'\\').append(kCleanerSuffixRegistryKey); + chrome_cleaner::kSoftwareRemovalToolRegistryKey); + cleaner_key_name.append(1, L'\\').append(chrome_cleaner::kCleanerSubKey); base::win::RegKey cleaner_key( HKEY_CURRENT_USER, cleaner_key_name.c_str(), KEY_ALL_ACCESS); // Cleaner is assumed to have run if we have a start time. if (cleaner_key.Valid()) { - if (cleaner_key.HasValue(safe_browsing::kStartTimeValueName)) { + if (cleaner_key.HasValue(chrome_cleaner::kStartTimeValueName)) { // Get version number. - if (cleaner_key.HasValue(kVersionValueName)) { + if (cleaner_key.HasValue(chrome_cleaner::kVersionValueName)) { DWORD version; - cleaner_key.ReadValueDW(kVersionValueName, &version); + cleaner_key.ReadValueDW(chrome_cleaner::kVersionValueName, &version); UMA_HISTOGRAM_SPARSE_SLOWLY("SoftwareReporter.Cleaner.Version", version); - cleaner_key.DeleteValue(kVersionValueName); + cleaner_key.DeleteValue(chrome_cleaner::kVersionValueName); } // Get start & end time. If we don't have an end time, we can assume the // cleaner has not completed. int64_t start_time_value; - cleaner_key.ReadInt64(safe_browsing::kStartTimeValueName, + cleaner_key.ReadInt64(chrome_cleaner::kStartTimeValueName, &start_time_value); - bool completed = cleaner_key.HasValue(safe_browsing::kEndTimeValueName); + bool completed = cleaner_key.HasValue(chrome_cleaner::kEndTimeValueName); SRTHasCompleted(completed ? SRT_COMPLETED_YES : SRT_COMPLETED_NOT_YET); if (completed) { int64_t end_time_value; - cleaner_key.ReadInt64(safe_browsing::kEndTimeValueName, + cleaner_key.ReadInt64(chrome_cleaner::kEndTimeValueName, &end_time_value); - cleaner_key.DeleteValue(safe_browsing::kEndTimeValueName); + cleaner_key.DeleteValue(chrome_cleaner::kEndTimeValueName); base::TimeDelta run_time( base::Time::FromInternalValue(end_time_value) - base::Time::FromInternalValue(start_time_value)); @@ -432,18 +427,18 @@ run_time); } // Get exit code. Assume nothing was found if we can't read the exit code. - DWORD exit_code = safe_browsing::kSwReporterNothingFound; - if (cleaner_key.HasValue(kExitCodeValueName)) { - cleaner_key.ReadValueDW(kExitCodeValueName, &exit_code); + DWORD exit_code = chrome_cleaner::kSwReporterNothingFound; + if (cleaner_key.HasValue(chrome_cleaner::kExitCodeValueName)) { + cleaner_key.ReadValueDW(chrome_cleaner::kExitCodeValueName, &exit_code); UMA_HISTOGRAM_SPARSE_SLOWLY("SoftwareReporter.Cleaner.ExitCode", exit_code); - cleaner_key.DeleteValue(kExitCodeValueName); + cleaner_key.DeleteValue(chrome_cleaner::kExitCodeValueName); } - cleaner_key.DeleteValue(safe_browsing::kStartTimeValueName); + cleaner_key.DeleteValue(chrome_cleaner::kStartTimeValueName); - if (exit_code == safe_browsing::kSwReporterPostRebootCleanupNeeded || + if (exit_code == chrome_cleaner::kSwReporterPostRebootCleanupNeeded || exit_code == - safe_browsing::kSwReporterDelayedPostRebootCleanupNeeded) { + chrome_cleaner::kSwReporterDelayedPostRebootCleanupNeeded) { // Check if we are running after the user has rebooted. base::TimeDelta elapsed( base::Time::Now() - @@ -454,15 +449,16 @@ static_cast<uint64_t>(elapsed.InMilliseconds()) > ::GetTickCount()); } - if (cleaner_key.HasValue(kUploadResultsValueName)) { + if (cleaner_key.HasValue(chrome_cleaner::kUploadResultsValueName)) { base::string16 upload_results; - cleaner_key.ReadValue(kUploadResultsValueName, &upload_results); + cleaner_key.ReadValue(chrome_cleaner::kUploadResultsValueName, + &upload_results); ReportUploadsWithUma(upload_results); } } else { - if (cleaner_key.HasValue(safe_browsing::kEndTimeValueName)) { + if (cleaner_key.HasValue(chrome_cleaner::kEndTimeValueName)) { SRTHasCompleted(SRT_COMPLETED_LATER); - cleaner_key.DeleteValue(safe_browsing::kEndTimeValueName); + cleaner_key.DeleteValue(chrome_cleaner::kEndTimeValueName); } } }
diff --git a/chrome/browser/extensions/native_bindings_apitest.cc b/chrome/browser/extensions/native_bindings_apitest.cc index 08869d4..a2891dc 100644 --- a/chrome/browser/extensions/native_bindings_apitest.cc +++ b/chrome/browser/extensions/native_bindings_apitest.cc
@@ -59,7 +59,16 @@ // A simplistic app test for app-specific APIs. IN_PROC_BROWSER_TEST_F(NativeBindingsApiTest, SimpleAppTest) { + ExtensionTestMessageListener ready_listener("ready", true); ASSERT_TRUE(RunPlatformAppTest("native_bindings/platform_app")) << message_; + ASSERT_TRUE(ready_listener.WaitUntilSatisfied()); + + // On reply, the extension will try to close the app window and send a + // message. + ExtensionTestMessageListener close_listener(false); + ready_listener.Reply(std::string()); + ASSERT_TRUE(close_listener.WaitUntilSatisfied()); + EXPECT_EQ("success", close_listener.message()); } // Tests the declarativeContent API and declarative events.
diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc index 886b108..105ec8b 100644 --- a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
@@ -253,7 +253,8 @@ // Extract the "settings" entry in the local state and serialize back to // a string. std::unique_ptr<base::DictionaryValue> local_state = - g_browser_process->local_state()->GetPreferenceValuesOmitDefaults(); + g_browser_process->local_state()->GetPreferenceValues( + PrefService::EXCLUDE_DEFAULTS); const base::DictionaryValue* local_state_settings = nullptr; if (!local_state->GetDictionary(kSettingsKey, &local_state_settings)) { VLOG(1) << "Failed to extract the settings entry from Local State.";
diff --git a/chrome/browser/plugins/flash_download_interception.cc b/chrome/browser/plugins/flash_download_interception.cc index 9a40a583..8b37e3c 100644 --- a/chrome/browser/plugins/flash_download_interception.cc +++ b/chrome/browser/plugins/flash_download_interception.cc
@@ -31,12 +31,16 @@ // Regexes matching const char kGetFlashURLCanonicalRegex[] = "(?i)get\\.adobe\\.com/.*flash.*"; -const char kGetFlashURLSecondaryRegex[] = +const char kGetFlashURLSecondaryGoRegex[] = "(?i)(www\\.)?(adobe|macromedia)\\.com/go/" "((?i).*get[-_]?flash|getfp10android|.*fl(ash)player|.*flashpl|" ".*flash_player|flash_completion|flashpm|.*flashdownload|d65_flplayer|" "fp_jp|runtimes_fp|[a-z_-]{3,6}h-m-a-?2|chrome|download_player|" "gnav_fl|pdcredirect).*"; +const char kGetFlashURLSecondaryDownloadRegex[] = + "(?i)(www\\.)?(adobe|macromedia)\\.com/shockwave/download/download.cgi"; +const char kGetFlashURLSecondaryDownloadQuery[] = + "P1_Prod_Version=ShockwaveFlash"; void DoNothing(ContentSetting result) {} @@ -107,7 +111,9 @@ std::string target_url_str = target_url.ReplaceComponents(replacements).GetContent(); if (RE2::FullMatch(target_url_str, kGetFlashURLCanonicalRegex) || - RE2::FullMatch(target_url_str, kGetFlashURLSecondaryRegex)) { + RE2::FullMatch(target_url_str, kGetFlashURLSecondaryGoRegex) || + (RE2::FullMatch(target_url_str, kGetFlashURLSecondaryDownloadRegex) && + target_url.query() == kGetFlashURLSecondaryDownloadQuery)) { ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting( host_content_settings_map, url::Origin(source_url), source_url, nullptr);
diff --git a/chrome/browser/plugins/flash_download_interception_unittest.cc b/chrome/browser/plugins/flash_download_interception_unittest.cc index bd12b0b1..2855e7fb 100644 --- a/chrome/browser/plugins/flash_download_interception_unittest.cc +++ b/chrome/browser/plugins/flash_download_interception_unittest.cc
@@ -42,7 +42,7 @@ base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeature(features::kPreferHtmlOverPlugins); - const char* flash_intercept_urls[] = { + const char* const flash_intercept_urls[] = { "https://get.adobe.com/flashplayer/", "http://get.adobe.com/flash", "http://get.adobe.com/fr/flashplayer/", @@ -52,6 +52,8 @@ "http://adobe.com/go/CA-H-GET-FLASH", "http://adobe.com/go/DE_CH-H-M-A2", "http://adobe.com/go/gntray_dl_getflashplayer_jp", + "http://www.adobe.com/shockwave/download/download.cgi?" + "P1_Prod_Version=ShockwaveFlash", }; for (auto* url : flash_intercept_urls) { @@ -59,8 +61,9 @@ << "Should have intercepted: " << url; } - const char* flash_no_intercept_urls[] = { - "https://www.example.com", "http://example.com/get.adobe.com/flashplayer", + const char* const flash_no_intercept_urls[] = { + "https://www.examplefoo.com", + "http://examplefoo.com/get.adobe.com/flashplayer", "http://ww.macromedia.com/go/getflashplayer", "http://wwwxmacromedia.com/go/getflashplayer", "http://www.adobe.com/software/flash/about/", @@ -72,6 +75,8 @@ // Don't match text within the query or fragment. "http://www.adobe.com/go/non-matching?foo=flashplayer", "http://www.adobe.com/go/non-matching#!foo=flashplayer", + "http://www.adobe.com/shockwave/download/download.cgi?" + "P1_Prod_Version=SomethingElse", }; for (auto* url : flash_no_intercept_urls) {
diff --git a/chrome/browser/prefs/pref_functional_browsertest.cc b/chrome/browser/prefs/pref_functional_browsertest.cc index 0d842ad..56d90df 100644 --- a/chrome/browser/prefs/pref_functional_browsertest.cc +++ b/chrome/browser/prefs/pref_functional_browsertest.cc
@@ -237,5 +237,7 @@ // Verify that we have some Local State prefs. IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestHaveLocalStatePrefs) { - EXPECT_TRUE(g_browser_process->local_state()->GetPreferenceValues().get()); + EXPECT_TRUE(g_browser_process->local_state() + ->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS) + .get()); }
diff --git a/chrome/browser/profiles/profile_statistics_aggregator.cc b/chrome/browser/profiles/profile_statistics_aggregator.cc index e3582be..7949b8f5 100644 --- a/chrome/browser/profiles/profile_statistics_aggregator.cc +++ b/chrome/browser/profiles/profile_statistics_aggregator.cc
@@ -26,6 +26,19 @@ namespace { +// Callback for each pref. Every one that should be counted as a changed +// user pref will cause *count to be incremented. +void AccumulatePrefStats(const PrefService* pref_service, + int* count, + const std::string& key, + const base::Value& value) { + const PrefService::Preference* pref = pref_service->FindPreference(key); + // Skip all dictionaries, only want to count values. + if (!value.is_dict() && pref && pref->IsUserControlled() && + !pref->IsDefaultValue()) + ++(*count); +} + int CountBookmarksFromNode(const bookmarks::BookmarkNode* node) { int count = 0; if (node->is_url()) { @@ -216,26 +229,9 @@ ProfileStatValue result; if (pref_service) { - std::unique_ptr<base::DictionaryValue> prefs = - pref_service->GetPreferenceValuesWithoutPathExpansion(); - - int count = 0; - for (base::DictionaryValue::Iterator it(*(prefs.get())); - !it.IsAtEnd(); it.Advance()) { - const PrefService::Preference* pref = pref_service-> - FindPreference(it.key()); - // Skip all dictionaries (which must be empty by the function call above). - if (it.value().GetType() != base::Value::Type::DICTIONARY && - pref && pref->IsUserControlled() && !pref->IsDefaultValue()) { - ++count; - } - } - - result.count = count; + pref_service->IteratePreferenceValues(base::BindRepeating( + &AccumulatePrefStats, pref_service, base::Unretained(&result.count))); result.success = true; - } else { - result.count = 0; - result.success = false; } return result; }
diff --git a/chrome/browser/profiles/profile_statistics_aggregator.h b/chrome/browser/profiles/profile_statistics_aggregator.h index 66e16fc..fc45518 100644 --- a/chrome/browser/profiles/profile_statistics_aggregator.h +++ b/chrome/browser/profiles/profile_statistics_aggregator.h
@@ -50,8 +50,8 @@ friend class base::RefCountedThreadSafe<ProfileStatisticsAggregator>; struct ProfileStatValue { - int count; - bool success; // false means the statistics failed to load + int count = 0; + bool success = false; // False means the statistics failed to load. }; ~ProfileStatisticsAggregator();
diff --git a/chrome/browser/resources/md_extensions/keyboard_shortcuts.html b/chrome/browser/resources/md_extensions/keyboard_shortcuts.html index 4cdc99a6a..f8afc544 100644 --- a/chrome/browser/resources/md_extensions/keyboard_shortcuts.html +++ b/chrome/browser/resources/md_extensions/keyboard_shortcuts.html
@@ -20,17 +20,22 @@ @apply(--shadow-elevation-2dp); background-color: white; color: var(--paper-grey-600); - margin-bottom: 10px; - padding: 20px; + margin: 0 auto 16px auto; + max-width: 928px; + min-width: 600px; + padding-bottom: 8px; width: 90%; } .command-entry { - align-items: flex-end; + align-items: center; display: flex; + font-size: 13px; + height: 48px; } .command-name { + color: var(--paper-grey-900); flex: 1; } @@ -40,20 +45,46 @@ .card-title { align-items: center; + border-bottom: 1px solid var(--paper-grey-400); display: flex; + font-size: 14px; + font-weight: 500; + margin-bottom: 9px; + padding: 16px 20px; } .icon { -webkit-margin-end: 20px; - height: 24px; - width: 24px; + height: 16px; + width: 16px; } .card-controls { /* We line up the controls with the name, which is after the - 24px icon + 20px margin on the icon. */ - -webkit-margin-start: 44px; + 20px left padding + 16px icon + 20px margin on the icon. */ + -webkit-margin-end: 20px; + -webkit-margin-start: 56px; } + + #main { + margin-top: 24px; + } + + #main paper-dropdown-menu { + --paper-input-container: { + margin-bottom: 14px; + padding: 0; + }; + --paper-input-container-color: var(--paper-grey-400); + --paper-input-container-focus-color: var(--google-blue-500); + --paper-input-container-input: { + font-size: 13px; + }; + --paper-input-container-underline-disabled: { + border-bottom: 1px solid; + }; + } + </style> <div id="main"> <template is="dom-repeat" items="[[calculateShownItems_(items.*)]]"> @@ -70,7 +101,8 @@ shortcut="[[command.keybinding]]" command-name="[[command.name]]"> </extensions-shortcut-input> - <paper-dropdown-menu label="$i18n{shortcutScopeLabel}"> + <paper-dropdown-menu + disabled$="[[computeScopeDisabled_(command)]]"> <paper-listbox class="dropdown-content" selected="[[computeSelectedScope_(command)]]"> <paper-item>$i18n{shortcutScopeInChrome}</paper-item>
diff --git a/chrome/browser/resources/md_extensions/keyboard_shortcuts.js b/chrome/browser/resources/md_extensions/keyboard_shortcuts.js index a0fe904..98dd95e 100644 --- a/chrome/browser/resources/md_extensions/keyboard_shortcuts.js +++ b/chrome/browser/resources/md_extensions/keyboard_shortcuts.js
@@ -47,6 +47,16 @@ }, /** + * Determines whether to disable the dropdown menu for the command's scope. + * @param {!chrome.developerPrivate.Command} command + * @return {boolean} + * @private + */ + computeScopeDisabled_: function(command) { + return command.isExtensionAction || !command.isActive; + }, + + /** * Returns the scope index in the dropdown menu for the command's scope. * @param {chrome.developerPrivate.Command} command * @return {number}
diff --git a/chrome/browser/resources/md_extensions/shortcut_input.html b/chrome/browser/resources/md_extensions/shortcut_input.html index d3a5c14..64fdc2c 100644 --- a/chrome/browser/resources/md_extensions/shortcut_input.html +++ b/chrome/browser/resources/md_extensions/shortcut_input.html
@@ -12,11 +12,38 @@ [hidden] { display: none !important; } + + #main { + position: relative; + width: 200px; + } + + #input { + --paper-input-container: { + margin-bottom: 12px; + padding: 0; + }; + --paper-input-container-color: var(--paper-grey-400); + --paper-input-container-focus-color: var(--google-blue-500); + --paper-input-container-input: { + font-size: 13px; + }; + } + + #clear { + bottom: 6px; + height: 16px; + padding: 0; + position: absolute; + right: 0; + width: 16px; + } + </style> <div id="main"> - <span id="input" tabindex="0"> - [[computeText_(capturing_, shortcut, pendingShortcut_)]] - </span> + <paper-input id="input" placeholder="$i18n{shortcutTypeAShortcut}" + value="[[computeText_(capturing_, shortcut, pendingShortcut_)]]"> + </paper-input> <paper-icon-button id="clear" icon="clear" on-tap="onClearTap_" hidden$="[[computeClearHidden_(capturing_, shortcut)]]"> </paper-icon-button>
diff --git a/chrome/browser/resources/md_extensions/shortcut_input.js b/chrome/browser/resources/md_extensions/shortcut_input.js index 7530662..542ad36 100644 --- a/chrome/browser/resources/md_extensions/shortcut_input.js +++ b/chrome/browser/resources/md_extensions/shortcut_input.js
@@ -142,8 +142,8 @@ */ computeText_: function() { if (this.capturing_) - return this.pendingShortcut_ || this.i18n('shortcutTypeAShortcut'); - return this.shortcut || this.i18n('shortcutNotSet'); + return this.pendingShortcut_; + return this.shortcut; }, /**
diff --git a/chrome/browser/resources/ntp4/guest_tab.html b/chrome/browser/resources/ntp4/guest_tab.html index 15b74f0..a89226c 100644 --- a/chrome/browser/resources/ntp4/guest_tab.html +++ b/chrome/browser/resources/ntp4/guest_tab.html
@@ -1,19 +1,16 @@ <!doctype html> -<html i18n-values="dir:textdirection;lang:language"> +<html dir="$i18n{textdirection}" lang="$i18n{language}"> <head> <meta charset="utf-8"> -<title i18n-content="title"></title> +<title>$i18n{title}</title> <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> <link rel="stylesheet" href="incognito_and_guest_tab.css"> </head> <body> <div class="content"> - <h1 i18n-content="guestTabHeading"></h1> - <p> - <span i18n-content="guestTabDescription"></span> - </p> - <a class="learn-more-button" i18n-content="learnMore" i18n-values=".href:learnMoreLink"></a> + <h1>$i18n{guestTabHeading}</h1> + <p>$i18n{guestTabDescription}</p> + <a class="learn-more-button" href="$i18n{learnMoreLink}">$i18n{learnMore}</a> </div> </body> -<script src="chrome://resources/js/cr.js"></script> </html>
diff --git a/chrome/browser/resources/settings/controls/controlled_radio_button.html b/chrome/browser/resources/settings/controls/controlled_radio_button.html index c19f779..b59221d32 100644 --- a/chrome/browser/resources/settings/controls/controlled_radio_button.html +++ b/chrome/browser/resources/settings/controls/controlled_radio_button.html
@@ -83,6 +83,10 @@ --primary-text-color); } + :host(:not([controlled_])) { + @apply(--settings-actionable); + } + :host([controlled_]) { /* Disable pointer events for this whole element, as outer on-tap gets * triggered when clicking/tapping anywhere in :host. */
diff --git a/chrome/browser/resources/settings/controls/settings_slider.html b/chrome/browser/resources/settings/controls/settings_slider.html index e80d1ca..bc10be0 100644 --- a/chrome/browser/resources/settings/controls/settings_slider.html +++ b/chrome/browser/resources/settings/controls/settings_slider.html
@@ -7,6 +7,10 @@ <template> <style> :host { + --calculated-paper-slider-height: var(--paper-slider-height, 2px); + /* Counteract the margin on #sliderContainer in paper-slider.html. */ + -webkit-margin-end: + calc(-15px - var(--calculated-paper-slider-height) / 2); display: inline-flex; }
diff --git a/chrome/browser/resources/settings/device_page/pointers.html b/chrome/browser/resources/settings/device_page/pointers.html index 6c7eaa1..ef0c121 100644 --- a/chrome/browser/resources/settings/device_page/pointers.html +++ b/chrome/browser/resources/settings/device_page/pointers.html
@@ -13,81 +13,83 @@ -webkit-padding-start: var(--settings-box-row-padding); } - /* Indent layout elements under .subsection, using margin instead of - * padding so the borders line up. */ - .subsection > .settings-box { - margin: 0 var(--settings-box-row-indent); - padding: 0; + .subsection { + -webkit-padding-end: var(--settings-box-row-padding); + -webkit-padding-start: var(--settings-box-row-indent); } - .subsection > .list-frame { - -webkit-margin-start: var(--settings-indent-width); + .subsection > .settings-box { + padding-left: 0; + padding-right: 0; } </style> - <div id="mouse" hidden$="[[!hasMouse]]" - class$="[[getSubsectionClass_(hasMouse, hasTouchpad)]]"> + <div id="mouse" hidden$="[[!hasMouse]]"> <!-- Subsection title only appears if both mouse and touchpad exist. --> <h2 hidden$="[[!hasTouchpad]]">$i18n{mouseTitle}</h2> - <div class="settings-box first"> - <!-- Do not change the mouse button pref before the mouse is released. - See crbug.com/686949 --> - <settings-toggle-button id="mouseSwapButton" class="start" - pref="{{prefs.settings.mouse.primary_right}}" - label="$i18n{mouseSwapButtons}" - on-settings-boolean-control-change="onMouseSwapButtonsChange_" - on-down="onMouseSwapButtonsDown_" on-up="onMouseSwapButtonsUp_" - no-set-pref> - </settings-toggle-button> - </div> - <div class="settings-box"> - <div class="start" id="mouseSpeedLabel">$i18n{mouseSpeed}</div> - <settings-slider pref="{{prefs.settings.mouse.sensitivity2}}" - tick-values="[[sensitivityValues_]]" - aria-labelledby="mouseSpeedLabel" - label-min="$i18n{pointerSlow}" - label-max="$i18n{pointerFast}"> - </settings-slider> - </div> - </div> - <div id="touchpad" hidden$="[[!hasTouchpad]]" - class$="[[getSubsectionClass_(hasMouse, hasTouchpad)]]"> - <!-- Subsection title only appears if both mouse and touchpad exist. --> - <h2 hidden$="[[!hasMouse]]">$i18n{touchpadTitle}</h2> - <div class="settings-box block first"> - <settings-toggle-button id="enableTapToClick" - pref="{{prefs.settings.touchpad.enable_tap_to_click}}" - label="$i18n{touchpadTapToClickEnabledLabel}"> - </settings-toggle-button> - <settings-toggle-button id="enableTapDragging" - pref="{{prefs.settings.touchpad.enable_tap_dragging}}" - label="$i18n{tapDraggingLabel}"> - </settings-toggle-button> - </div> - <div class="settings-box"> - <div class="start" id="touchpadSpeedLabel">$i18n{touchpadSpeed}</div> - <settings-slider id="touchpadSensitivity" - pref="{{prefs.settings.touchpad.sensitivity2}}" + <div class$="[[getSubsectionClass_(hasMouse, hasTouchpad)]]"> + <div class="settings-box first"> + <!-- Do not change the mouse button pref before the mouse is released. + See crbug.com/686949 --> + <settings-toggle-button id="mouseSwapButton" class="start" + pref="{{prefs.settings.mouse.primary_right}}" + label="$i18n{mouseSwapButtons}" + on-settings-boolean-control-change="onMouseSwapButtonsChange_" + on-down="onMouseSwapButtonsDown_" on-up="onMouseSwapButtonsUp_" + no-set-pref> + </settings-toggle-button> + </div> + <div class="settings-box"> + <div class="start" id="mouseSpeedLabel">$i18n{mouseSpeed}</div> + <settings-slider pref="{{prefs.settings.mouse.sensitivity2}}" tick-values="[[sensitivityValues_]]" - aria-labelledby="touchpadSpeedLabel" + aria-labelledby="mouseSpeedLabel" label-min="$i18n{pointerSlow}" label-max="$i18n{pointerFast}"> </settings-slider> + </div> </div> - <div class="settings-box">$i18n{scrollLabel}</div> - <div class="list-frame"> - <settings-radio-group pref="{{prefs.settings.touchpad.natural_scroll}}"> - <paper-radio-button name="false"> - $i18n{traditionalScrollLabel} - </paper-radio-button> - <paper-radio-button name="true"> - $i18n{naturalScrollLabel} - <a href="$i18n{naturalScrollLearnMoreLink}" target="_blank" - on-tap="onLearnMoreLinkActivated_" - on-keydown="onLearnMoreLinkActivated_"> - $i18n{naturalScrollLearnMore} - </a> - </paper-radio-button> - </settings-radio-group> + </div> + <div id="touchpad" hidden$="[[!hasTouchpad]]"> + <!-- Subsection title only appears if both mouse and touchpad exist. --> + <h2 hidden$="[[!hasMouse]]">$i18n{touchpadTitle}</h2> + <div class$="[[getSubsectionClass_(hasMouse, hasTouchpad)]]"> + <div class="settings-box block first"> + <settings-toggle-button id="enableTapToClick" + pref="{{prefs.settings.touchpad.enable_tap_to_click}}" + label="$i18n{touchpadTapToClickEnabledLabel}"> + </settings-toggle-button> + <settings-toggle-button id="enableTapDragging" + pref="{{prefs.settings.touchpad.enable_tap_dragging}}" + label="$i18n{tapDraggingLabel}"> + </settings-toggle-button> + </div> + <div class="settings-box"> + <div class="start" id="touchpadSpeedLabel">$i18n{touchpadSpeed}</div> + <settings-slider id="touchpadSensitivity" + pref="{{prefs.settings.touchpad.sensitivity2}}" + tick-values="[[sensitivityValues_]]" + aria-labelledby="touchpadSpeedLabel" + label-min="$i18n{pointerSlow}" + label-max="$i18n{pointerFast}"> + </settings-slider> + </div> + <div class="settings-box">$i18n{scrollLabel}</div> + <div class="list-frame"> + <settings-radio-group + pref="{{prefs.settings.touchpad.natural_scroll}}"> + <paper-radio-button name="false"> + $i18n{traditionalScrollLabel} + </paper-radio-button> + <paper-radio-button name="true"> + $i18n{naturalScrollLabel} + <a href="$i18n{naturalScrollLearnMoreLink}" target="_blank" + on-tap="onLearnMoreLinkActivated_" + on-keydown="onLearnMoreLinkActivated_"> + $i18n{naturalScrollLearnMore} + </a> + </paper-radio-button> + </settings-radio-group> + </div> </div> </div> </template>
diff --git a/chrome/browser/safe_browsing/srt_client_info_win.cc b/chrome/browser/safe_browsing/srt_client_info_win.cc index 6faa2dfa..7506dac 100644 --- a/chrome/browser/safe_browsing/srt_client_info_win.cc +++ b/chrome/browser/safe_browsing/srt_client_info_win.cc
@@ -24,12 +24,6 @@ } // namespace -const char kChromeChannelSwitch[] = "chrome-channel"; -const char kChromeVersionSwitch[] = "chrome-version"; -const char kEnableCrashReporting[] = "enable-crash-reporting"; -const char kExtendedSafeBrowsingEnabledSwitch[] = - "extended-safebrowsing-enabled"; - int ChannelAsInt() { switch (chrome::GetChannel()) { case version_info::Channel::UNKNOWN:
diff --git a/chrome/browser/safe_browsing/srt_client_info_win.h b/chrome/browser/safe_browsing/srt_client_info_win.h index dfa14eb..608ee96 100644 --- a/chrome/browser/safe_browsing/srt_client_info_win.h +++ b/chrome/browser/safe_browsing/srt_client_info_win.h
@@ -7,11 +7,6 @@ namespace safe_browsing { -extern const char kChromeChannelSwitch[]; -extern const char kChromeVersionSwitch[]; -extern const char kEnableCrashReporting[]; -extern const char kExtendedSafeBrowsingEnabledSwitch[]; - // Encodes Chrome's channel as an integer to be passed to the SRT on the command // line. The SRT binary expects to receive Chrome's channel encoded as: // 0: unknown; 1: canary; 2: dev; 3: beta; 4: stable.
diff --git a/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc b/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc index 3d7336b..328c9be 100644 --- a/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc +++ b/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc
@@ -36,6 +36,7 @@ #include "chrome/browser/ui/test/test_browser_dialog.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" +#include "components/chrome_cleaner/public/constants/constants.h" #include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h" #include "components/component_updater/pref_names.h" #include "components/prefs/pref_service.h" @@ -197,8 +198,8 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); const std::string& str = command_line->GetSwitchValueASCII(kExitCodeToReturnSwitch); - const std::string& chrome_mojo_pipe_token = - command_line->GetSwitchValueASCII(kChromeMojoPipeTokenSwitch); + const std::string& chrome_mojo_pipe_token = command_line->GetSwitchValueASCII( + chrome_cleaner::kChromeMojoPipeTokenSwitch); int exit_code_to_report = kFailureExitCode; bool success = base::StringToInt(str, &exit_code_to_report) && (chrome_mojo_pipe_token.empty() || @@ -287,7 +288,7 @@ base::IntToString(exit_code_to_report_)); if (in_browser_cleaner_ui_) { AddPromptAcceptanceToCommandLine(PromptAcceptance::DENIED, &command_line); - if (exit_code_to_report_ == kSwReporterCleanupNeeded) { + if (exit_code_to_report_ == chrome_cleaner::kSwReporterCleanupNeeded) { command_line.AppendSwitch(kReportUwSFoundSwitch); if (elevation_status_ == ElevationStatus::REQUIRED) command_line.AppendSwitch(kReportElevationRequiredSwitch); @@ -443,8 +444,9 @@ void ExpectLoggingSwitches(const SwReporterInvocation& invocation, bool expect_switches) { static const std::set<std::string> logging_switches{ - kExtendedSafeBrowsingEnabledSwitch, kChromeVersionSwitch, - kChromeChannelSwitch}; + chrome_cleaner::kExtendedSafeBrowsingEnabledSwitch, + chrome_cleaner::kChromeVersionSwitch, + chrome_cleaner::kChromeChannelSwitch}; const base::CommandLine::SwitchMap& invocation_switches = invocation.command_line.GetSwitches(); @@ -495,13 +497,13 @@ } // namespace IN_PROC_BROWSER_TEST_P(SRTFetcherTest, NothingFound) { - RunReporter(kSwReporterNothingFound); + RunReporter(chrome_cleaner::kSwReporterNothingFound); ExpectReporterLaunches(0, 1, false); ExpectToRunAgain(kDaysBetweenSuccessfulSwReporterRuns); } IN_PROC_BROWSER_TEST_P(SRTFetcherTest, CleanupNeeded) { - RunReporter(kSwReporterCleanupNeeded); + RunReporter(chrome_cleaner::kSwReporterCleanupNeeded); ExpectReporterLaunches(0, 1, true); ExpectToRunAgain(kDaysBetweenSuccessfulSwReporterRuns); } @@ -509,7 +511,7 @@ IN_PROC_BROWSER_TEST_P(SRTFetcherTest, RanRecently) { constexpr int kDaysLeft = 1; SetDaysSinceLastTriggered(kDaysBetweenSuccessfulSwReporterRuns - kDaysLeft); - RunReporter(kSwReporterNothingFound); + RunReporter(chrome_cleaner::kSwReporterNothingFound); ExpectReporterLaunches(0, 0, false); ExpectToRunAgain(kDaysLeft); ExpectReporterLaunches(kDaysLeft, 1, false); @@ -535,7 +537,7 @@ ASSERT_FALSE(chrome::FindLastActive()); // Start the reporter while the browser is closed. The prompt should not open. - RunReporter(kSwReporterCleanupNeeded); + RunReporter(chrome_cleaner::kSwReporterCleanupNeeded); ExpectReporterLaunches(0, 1, false); // Create a Browser object directly instead of using helper functions like @@ -569,7 +571,7 @@ SetDaysSinceLastTriggered(kDaysBetweenSuccessfulSwReporterRuns - 1); ASSERT_GT(kDaysBetweenSuccessfulSwReporterRuns - 1, kDaysBetweenSwReporterRunsForPendingPrompt); - RunReporter(kSwReporterNothingFound); + RunReporter(chrome_cleaner::kSwReporterNothingFound); // Expect the reporter to run immediately, since a prompt is pending and it // has been more than kDaysBetweenSwReporterRunsForPendingPrompt days. @@ -605,7 +607,7 @@ { SCOPED_TRACE("N days left until next reporter run"); SetDaysSinceLastTriggered(kDaysBetweenSuccessfulSwReporterRuns - kDaysLeft); - RunReporter(kSwReporterNothingFound, path1); + RunReporter(chrome_cleaner::kSwReporterNothingFound, path1); ExpectReporterLaunches(0, {}, false); } @@ -613,9 +615,9 @@ // Now the reporter should launch, just once, using path2. { SCOPED_TRACE("Reporter runs now"); - RunReporter(kSwReporterNothingFound, path2); + RunReporter(chrome_cleaner::kSwReporterNothingFound, path2); // Schedule it twice; it should only actually run once. - RunReporter(kSwReporterNothingFound, path2); + RunReporter(chrome_cleaner::kSwReporterNothingFound, path2); ExpectReporterLaunches(kDaysLeft, {path2}, false); } @@ -623,7 +625,7 @@ // The reporter should not launch. { SCOPED_TRACE("No more time passed"); - RunReporter(kSwReporterNothingFound, path3); + RunReporter(chrome_cleaner::kSwReporterNothingFound, path3); ExpectReporterLaunches(0, {}, false); } @@ -641,7 +643,7 @@ // passed, even though the parameters haven't changed. { SCOPED_TRACE("Run with same parameters"); - RunReporter(kSwReporterNothingFound, path3); + RunReporter(chrome_cleaner::kSwReporterNothingFound, path3); ExpectReporterLaunches(kDaysBetweenSuccessfulSwReporterRuns, {path3}, false); } @@ -661,7 +663,7 @@ { SCOPED_TRACE("Launch 2 times"); SetDaysSinceLastTriggered(kDaysBetweenSuccessfulSwReporterRuns); - RunReporterQueue(kSwReporterNothingFound, invocations); + RunReporterQueue(chrome_cleaner::kSwReporterNothingFound, invocations); ExpectReporterLaunches(0, {path1, path2}, false); ExpectToRunAgain(kDaysBetweenSuccessfulSwReporterRuns); } @@ -670,8 +672,8 @@ // just run 2 times, not 4. { SCOPED_TRACE("Launch 2 times with retry"); - RunReporterQueue(kSwReporterNothingFound, invocations); - RunReporterQueue(kSwReporterNothingFound, invocations); + RunReporterQueue(chrome_cleaner::kSwReporterNothingFound, invocations); + RunReporterQueue(chrome_cleaner::kSwReporterNothingFound, invocations); ExpectReporterLaunches(kDaysBetweenSuccessfulSwReporterRuns, {path1, path2}, false); ExpectToRunAgain(kDaysBetweenSuccessfulSwReporterRuns); @@ -684,7 +686,7 @@ invocations.push(SwReporterInvocation::FromFilePath(path3)); first_launch_callback_ = base::BindOnce( &SRTFetcherTest::RunReporterQueue, base::Unretained(this), - kSwReporterNothingFound, invocations); + chrome_cleaner::kSwReporterNothingFound, invocations); // Only the first two elements should execute since the third was added // during the cycle. @@ -718,7 +720,7 @@ } IN_PROC_BROWSER_TEST_P(SRTFetcherTest, ReporterLogging_NoSBExtendedReporting) { - RunReporter(kSwReporterNothingFound); + RunReporter(chrome_cleaner::kSwReporterNothingFound); ExpectReporterLaunches(0, 1, false); ExpectLoggingSwitches(reporter_launch_parameters_.front(), false); ExpectLastTimeSentReportNotSet(); @@ -730,7 +732,7 @@ // Note: don't set last time sent logs in the local state. // SBER is enabled and there is no record in the local state of the last time // logs have been sent, so we should send logs in this run. - RunReporter(kSwReporterNothingFound); + RunReporter(chrome_cleaner::kSwReporterNothingFound); ExpectReporterLaunches(0, 1, false); ExpectLoggingSwitches(reporter_launch_parameters_.front(), true); ExpectLastReportSentInTheLastHour(); @@ -742,7 +744,7 @@ // |kDaysBetweenReporterLogsSent| day ago, so we should send logs in this run. EnableSBExtendedReporting(); SetLastTimeSentReport(kDaysBetweenReporterLogsSent + 3); - RunReporter(kSwReporterNothingFound); + RunReporter(chrome_cleaner::kSwReporterNothingFound); ExpectReporterLaunches(0, 1, false); ExpectLoggingSwitches(reporter_launch_parameters_.front(), true); ExpectLastReportSentInTheLastHour(); @@ -756,7 +758,7 @@ EnableSBExtendedReporting(); SetLastTimeSentReport(kDaysBetweenReporterLogsSent - 1); int64_t last_time_sent_logs = GetLastTimeSentReport(); - RunReporter(kSwReporterNothingFound); + RunReporter(chrome_cleaner::kSwReporterNothingFound); ExpectReporterLaunches(0, 1, false); ExpectLoggingSwitches(reporter_launch_parameters_.front(), false); EXPECT_EQ(last_time_sent_logs, GetLastTimeSentReport()); @@ -776,7 +778,7 @@ SwReporterInvocation::BEHAVIOUR_ALLOW_SEND_REPORTER_LOGS; invocations.push(invocation); } - RunReporterQueue(kSwReporterNothingFound, invocations); + RunReporterQueue(chrome_cleaner::kSwReporterNothingFound, invocations); // SBER is enabled and last time logs were sent was more than // |kDaysBetweenReporterLogsSent| day ago, so we should send logs in this run.
diff --git a/chrome/browser/safe_browsing/srt_fetcher_win.cc b/chrome/browser/safe_browsing/srt_fetcher_win.cc index f3509738..2405a4a2 100644 --- a/chrome/browser/safe_browsing/srt_fetcher_win.cc +++ b/chrome/browser/safe_browsing/srt_fetcher_win.cc
@@ -44,6 +44,7 @@ #include "chrome/browser/ui/global_error/global_error_service.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/chrome_cleaner/public/constants/constants.h" #include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h" #include "components/component_updater/pref_names.h" #include "components/data_use_measurement/core/data_use_user_data.h" @@ -65,21 +66,9 @@ namespace safe_browsing { -// TODO(b/647763) Change the registry key to properly handle cases when the user -// runs Google Chrome stable alongside Google Chrome SxS. -const wchar_t kSoftwareRemovalToolRegistryKey[] = - L"Software\\Google\\Software Removal Tool"; - -const wchar_t kCleanerSubKey[] = L"Cleaner"; - -const wchar_t kEndTimeValueName[] = L"EndTime"; -const wchar_t kStartTimeValueName[] = L"StartTime"; - const base::Feature kInBrowserCleanerUIFeature{ "InBrowserCleanerUI", base::FEATURE_DISABLED_BY_DEFAULT}; -const char kChromeMojoPipeTokenSwitch[] = "chrome-mojo-pipe-token"; - namespace { // Used to send UMA information about missing start and end time registry @@ -148,13 +137,6 @@ SwReporterTestingDelegate* g_testing_delegate_ = nullptr; -const wchar_t kScanTimesSubKey[] = L"ScanTimes"; -const wchar_t kFoundUwsValueName[] = L"FoundUws"; -const wchar_t kMemoryUsedValueName[] = L"MemoryUsed"; -const wchar_t kLogsUploadResultValueName[] = L"LogsUploadResult"; -const wchar_t kExitCodeValueName[] = L"ExitCode"; -const wchar_t kEngineErrorCodeValueName[] = L"EngineErrorCode"; - const char kFoundUwsMetricName[] = "SoftwareReporter.FoundUwS"; const char kFoundUwsReadErrorMetricName[] = "SoftwareReporter.FoundUwSReadError"; @@ -182,12 +164,12 @@ explicit UMAHistogramReporter(const std::string& suffix) : suffix_(suffix), - registry_key_(suffix.empty() ? kSoftwareRemovalToolRegistryKey - : base::StringPrintf( - L"%ls\\%ls", - kSoftwareRemovalToolRegistryKey, - base::UTF8ToUTF16(suffix).c_str())) { - } + registry_key_(suffix.empty() + ? chrome_cleaner::kSoftwareRemovalToolRegistryKey + : base::StringPrintf( + L"%ls\\%ls", + chrome_cleaner::kSoftwareRemovalToolRegistryKey, + base::UTF8ToUTF16(suffix).c_str())) {} // Reports the software reporter tool's version via UMA. void ReportVersion(const base::Version& version) const { @@ -225,13 +207,13 @@ DWORD exit_code_in_registry; if (reporter_key.Open(HKEY_CURRENT_USER, registry_key_.c_str(), KEY_QUERY_VALUE | KEY_SET_VALUE) != ERROR_SUCCESS || - reporter_key.ReadValueDW(kExitCodeValueName, &exit_code_in_registry) != - ERROR_SUCCESS) { + reporter_key.ReadValueDW(chrome_cleaner::kExitCodeValueName, + &exit_code_in_registry) != ERROR_SUCCESS) { return; } RecordSparseHistogram(kExitCodeMetricName, exit_code_in_registry); - reporter_key.DeleteValue(kExitCodeValueName); + reporter_key.DeleteValue(chrome_cleaner::kExitCodeValueName); } void ReportEngineErrorCode() const { @@ -239,13 +221,13 @@ DWORD engine_error_code; if (reporter_key.Open(HKEY_CURRENT_USER, registry_key_.c_str(), KEY_QUERY_VALUE | KEY_SET_VALUE) != ERROR_SUCCESS || - reporter_key.ReadValueDW(kEngineErrorCodeValueName, + reporter_key.ReadValueDW(chrome_cleaner::kEngineErrorCodeValueName, &engine_error_code) != ERROR_SUCCESS) { return; } RecordSparseHistogram(kEngineErrorCodeMetricName, engine_error_code); - reporter_key.DeleteValue(kEngineErrorCodeValueName); + reporter_key.DeleteValue(chrome_cleaner::kEngineErrorCodeValueName); } // Reports UwS found by the software reporter tool via UMA and RAPPOR. @@ -254,8 +236,8 @@ std::vector<base::string16> found_uws_strings; if (reporter_key.Open(HKEY_CURRENT_USER, registry_key_.c_str(), KEY_QUERY_VALUE | KEY_SET_VALUE) != ERROR_SUCCESS || - reporter_key.ReadValues(kFoundUwsValueName, &found_uws_strings) != - ERROR_SUCCESS) { + reporter_key.ReadValues(chrome_cleaner::kFoundUwsValueName, + &found_uws_strings) != ERROR_SUCCESS) { return; } @@ -271,7 +253,7 @@ } // Clean up the old value. - reporter_key.DeleteValue(kFoundUwsValueName); + reporter_key.DeleteValue(chrome_cleaner::kFoundUwsValueName); RecordBooleanHistogram(kFoundUwsReadErrorMetricName, parse_error); } @@ -282,12 +264,12 @@ DWORD memory_used = 0; if (reporter_key.Open(HKEY_CURRENT_USER, registry_key_.c_str(), KEY_QUERY_VALUE | KEY_SET_VALUE) != ERROR_SUCCESS || - reporter_key.ReadValueDW(kMemoryUsedValueName, &memory_used) != - ERROR_SUCCESS) { + reporter_key.ReadValueDW(chrome_cleaner::kMemoryUsedValueName, + &memory_used) != ERROR_SUCCESS) { return; } RecordMemoryKBHistogram(kMemoryUsedMetricName, memory_used); - reporter_key.DeleteValue(kMemoryUsedValueName); + reporter_key.DeleteValue(chrome_cleaner::kMemoryUsedValueName); } // Reports the SwReporter run time with UMA both as reported by the tool via @@ -309,20 +291,20 @@ bool has_start_time = false; int64_t start_time_value = 0; - if (reporter_key.HasValue(kStartTimeValueName) && - reporter_key.ReadInt64(kStartTimeValueName, &start_time_value) == - ERROR_SUCCESS) { + if (reporter_key.HasValue(chrome_cleaner::kStartTimeValueName) && + reporter_key.ReadInt64(chrome_cleaner::kStartTimeValueName, + &start_time_value) == ERROR_SUCCESS) { has_start_time = true; - reporter_key.DeleteValue(kStartTimeValueName); + reporter_key.DeleteValue(chrome_cleaner::kStartTimeValueName); } bool has_end_time = false; int64_t end_time_value = 0; - if (reporter_key.HasValue(kEndTimeValueName) && - reporter_key.ReadInt64(kEndTimeValueName, &end_time_value) == - ERROR_SUCCESS) { + if (reporter_key.HasValue(chrome_cleaner::kEndTimeValueName) && + reporter_key.ReadInt64(chrome_cleaner::kEndTimeValueName, + &end_time_value) == ERROR_SUCCESS) { has_end_time = true; - reporter_key.DeleteValue(kEndTimeValueName); + reporter_key.DeleteValue(chrome_cleaner::kEndTimeValueName); } if (has_start_time && has_end_time) { @@ -353,7 +335,7 @@ // Reports the UwS scan times of the software reporter tool via UMA. void ReportScanTimes() const { base::string16 scan_times_key_path = base::StringPrintf( - L"%ls\\%ls", registry_key_.c_str(), kScanTimesSubKey); + L"%ls\\%ls", registry_key_.c_str(), chrome_cleaner::kScanTimesSubKey); // TODO(b/641081): This should only have KEY_QUERY_VALUE and KEY_SET_VALUE. base::win::RegKey scan_times_key; if (scan_times_key.Open(HKEY_CURRENT_USER, scan_times_key_path.c_str(), @@ -385,7 +367,7 @@ base::win::RegKey reporter_key; if (reporter_key.Open(HKEY_CURRENT_USER, registry_key_.c_str(), KEY_ENUMERATE_SUB_KEYS) == ERROR_SUCCESS) { - reporter_key.DeleteKey(kScanTimesSubKey); + reporter_key.DeleteKey(chrome_cleaner::kScanTimesSubKey); } } @@ -410,7 +392,7 @@ return; } - if (reporter_key.ReadValueDW(kLogsUploadResultValueName, + if (reporter_key.ReadValueDW(chrome_cleaner::kLogsUploadResultValueName, &logs_upload_result) != ERROR_SUCCESS) { RecordEnumerationHistogram( kLogsUploadResultRegistryErrorMetricName, @@ -430,7 +412,7 @@ RecordEnumerationHistogram(kLogsUploadResultMetricName, static_cast<Sample>(logs_upload_result), kSwReporterLogsUploadResultMax); - reporter_key.DeleteValue(kLogsUploadResultValueName); + reporter_key.DeleteValue(chrome_cleaner::kLogsUploadResultValueName); RecordEnumerationHistogram(kLogsUploadResultRegistryErrorMetricName, REPORTER_LOGS_UPLOAD_RESULT_ERROR_NO_ERROR, REPORTER_LOGS_UPLOAD_RESULT_ERROR_MAX); @@ -666,8 +648,8 @@ std::string mojo_pipe_token; mojo::ScopedMessagePipeHandle mojo_pipe = pending_process_connection.CreateMessagePipe(&mojo_pipe_token); - invocation_.command_line.AppendSwitchASCII(kChromeMojoPipeTokenSwitch, - mojo_pipe_token); + invocation_.command_line.AppendSwitchASCII( + chrome_cleaner::kChromeMojoPipeTokenSwitch, mojo_pipe_token); mojo::edk::PlatformChannelPair channel; base::HandlesToInheritVector handles_to_inherit; @@ -1005,8 +987,8 @@ return; } - if (exit_code != kSwReporterPostRebootCleanupNeeded && - exit_code != kSwReporterCleanupNeeded) { + if (exit_code != chrome_cleaner::kSwReporterPostRebootCleanupNeeded && + exit_code != chrome_cleaner::kSwReporterCleanupNeeded) { RecordReporterStepHistogram(SW_REPORTER_NO_PROMPT_NEEDED); return; } @@ -1127,17 +1109,20 @@ } if (ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) - next_invocation->command_line.AppendSwitch(kEnableCrashReporting); + next_invocation->command_line.AppendSwitch( + chrome_cleaner::kEnableCrashReportingSwitch); } // Adds switches to be sent to the Software Reporter when the user opted into // extended Safe Browsing reporting and is not incognito. void AddSwitchesForExtendedReportingUser(SwReporterInvocation* invocation) { - invocation->command_line.AppendSwitch(kExtendedSafeBrowsingEnabledSwitch); + invocation->command_line.AppendSwitch( + chrome_cleaner::kExtendedSafeBrowsingEnabledSwitch); invocation->command_line.AppendSwitchASCII( - kChromeVersionSwitch, version_info::GetVersionNumber()); + chrome_cleaner::kChromeVersionSwitch, version_info::GetVersionNumber()); invocation->command_line.AppendSwitchNative( - kChromeChannelSwitch, base::IntToString16(ChannelAsInt())); + chrome_cleaner::kChromeChannelSwitch, + base::IntToString16(ChannelAsInt())); } bool first_run_ = true; @@ -1220,12 +1205,13 @@ if (!local_state) return false; int exit_code = local_state->GetInteger(prefs::kSwReporterLastExitCode); - return exit_code == kSwReporterCleanupNeeded; + return exit_code == chrome_cleaner::kSwReporterCleanupNeeded; } bool UserHasRunCleaner() { - base::string16 cleaner_key_path(kSoftwareRemovalToolRegistryKey); - cleaner_key_path.append(L"\\").append(kCleanerSubKey); + base::string16 cleaner_key_path( + chrome_cleaner::kSoftwareRemovalToolRegistryKey); + cleaner_key_path.append(L"\\").append(chrome_cleaner::kCleanerSubKey); base::win::RegKey srt_cleaner_key; return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(),
diff --git a/chrome/browser/safe_browsing/srt_fetcher_win.h b/chrome/browser/safe_browsing/srt_fetcher_win.h index a6e79e1..2d1ca85 100644 --- a/chrome/browser/safe_browsing/srt_fetcher_win.h +++ b/chrome/browser/safe_browsing/srt_fetcher_win.h
@@ -27,17 +27,6 @@ namespace safe_browsing { -// SRT registry keys and value names. -extern const wchar_t kSoftwareRemovalToolRegistryKey[]; -extern const wchar_t kEndTimeValueName[]; -extern const wchar_t kStartTimeValueName[]; - -// Reporter exit codes. -const int kSwReporterCleanupNeeded = 0; -const int kSwReporterNothingFound = 2; -const int kSwReporterPostRebootCleanupNeeded = 4; -const int kSwReporterDelayedPostRebootCleanupNeeded = 15; - // A special exit code identifying a failure to run the reporter. const int kReporterFailureExitCode = INT_MAX; @@ -51,11 +40,6 @@ // Chrome Cleanup tool to Chrome. extern const base::Feature kInBrowserCleanerUIFeature; -// The switch to be passed to the Software Reporter process with the Mojo pipe -// token for the IPC communication with Chrome. -// TODO(crbug/709035) Move this to //components/chrome_cleaner. -extern const char kChromeMojoPipeTokenSwitch[]; - // Parameters used to invoke the sw_reporter component. struct SwReporterInvocation { base::CommandLine command_line;
diff --git a/chrome/browser/safe_browsing/srt_global_error_win.cc b/chrome/browser/safe_browsing/srt_global_error_win.cc index 28cd7dd..7ca6a95 100644 --- a/chrome/browser/safe_browsing/srt_global_error_win.cc +++ b/chrome/browser/safe_browsing/srt_global_error_win.cc
@@ -29,6 +29,7 @@ #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chrome/installer/util/install_util.h" +#include "components/chrome_cleaner/public/constants/constants.h" #include "components/component_updater/pref_names.h" #include "components/prefs/pref_service.h" #include "components/version_info/version_info.h" @@ -52,26 +53,11 @@ // downloaded. const base::FilePath::CharType kExecutableExtension[] = L"exe"; -// Switches to add to the command line when executing the SRT. -const char kChromePromptSwitch[] = "chrome-prompt"; -const char kChromeExePathSwitch[] = "chrome-exe-path"; -const char kChromeSystemInstallSwitch[] = "chrome-system-install"; -const char kUmaUserSwitch[] = "uma-user"; - -// Values to be passed to the kChromePromptSwitch of the Chrome Cleanup Tool to -// indicate how the user interacted with the accept button. -enum class ChromePromptValue { - // The user accepted the prompt when the prompt was first shown. - kPrompted = 3, - // The user accepted the prompt after navigating to it from the menu. - kShownFromMenu = 4 -}; - void MaybeExecuteSRTFromBlockingPool( const base::FilePath& downloaded_path, bool metrics_enabled, bool sber_enabled, - ChromePromptValue prompt_value, + chrome_cleaner::ChromePromptValue prompt_value, const scoped_refptr<SingleThreadTaskRunner>& task_runner, const base::Closure& success_callback, const base::Closure& failure_callback) { @@ -83,26 +69,30 @@ if (base::ReplaceFile(downloaded_path, executable_path, nullptr)) { base::CommandLine srt_command_line(executable_path); srt_command_line.AppendSwitchASCII( - kChromePromptSwitch, + chrome_cleaner::kChromePromptSwitch, base::IntToString(static_cast<int>(prompt_value))); - srt_command_line.AppendSwitchASCII(kChromeVersionSwitch, + srt_command_line.AppendSwitchASCII(chrome_cleaner::kChromeVersionSwitch, version_info::GetVersionNumber()); - srt_command_line.AppendSwitchASCII(kChromeChannelSwitch, + srt_command_line.AppendSwitchASCII(chrome_cleaner::kChromeChannelSwitch, base::IntToString(ChannelAsInt())); base::FilePath chrome_exe_path; PathService::Get(base::FILE_EXE, &chrome_exe_path); - srt_command_line.AppendSwitchPath(kChromeExePathSwitch, chrome_exe_path); + srt_command_line.AppendSwitchPath(chrome_cleaner::kChromeExePathSwitch, + chrome_exe_path); if (!InstallUtil::IsPerUserInstall()) - srt_command_line.AppendSwitch(kChromeSystemInstallSwitch); + srt_command_line.AppendSwitch( + chrome_cleaner::kChromeSystemInstallSwitch); if (metrics_enabled) { - srt_command_line.AppendSwitch(kUmaUserSwitch); - srt_command_line.AppendSwitch(kEnableCrashReporting); + srt_command_line.AppendSwitch(chrome_cleaner::kUmaUserSwitch); + srt_command_line.AppendSwitch( + chrome_cleaner::kEnableCrashReportingSwitch); } if (sber_enabled) - srt_command_line.AppendSwitch(kExtendedSafeBrowsingEnabledSwitch); + srt_command_line.AppendSwitch( + chrome_cleaner::kExtendedSafeBrowsingEnabledSwitch); base::Process srt_process( base::LaunchProcess(srt_command_line, base::LaunchOptions())); @@ -233,14 +223,16 @@ // from the global_error_service_ in the call to OnUserInteractionStarted. // This means that it is safe to use base::Unretained here. base::PostTaskWithTraits( - FROM_HERE, base::TaskTraits().MayBlock().WithPriority( - base::TaskPriority::BACKGROUND), + FROM_HERE, + base::TaskTraits().MayBlock().WithPriority( + base::TaskPriority::BACKGROUND), base::Bind( &MaybeExecuteSRTFromBlockingPool, downloaded_path_, ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), SafeBrowsingExtendedReportingEnabled(), - bubble_shown_from_menu_ ? ChromePromptValue::kShownFromMenu - : ChromePromptValue::kPrompted, + bubble_shown_from_menu_ + ? chrome_cleaner::ChromePromptValue::kShownFromMenu + : chrome_cleaner::ChromePromptValue::kPrompted, base::ThreadTaskRunnerHandle::Get(), base::Bind(&SRTGlobalError::OnUserinteractionDone, base::Unretained(this)),
diff --git a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc index 6d64d27..a2aa3be 100644 --- a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc +++ b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
@@ -235,7 +235,6 @@ EXPECT_EQ(expect_security_level, security_info.security_level); EXPECT_EQ(expect_sha1_in_chain, security_info.sha1_in_chain); EXPECT_EQ(expect_mixed_content_status, security_info.mixed_content_status); - EXPECT_TRUE(security_info.sct_verify_statuses.empty()); EXPECT_TRUE(security_info.scheme_is_cryptographic); EXPECT_EQ(pkp_bypassed, security_info.pkp_bypassed); EXPECT_EQ(expect_cert_error, @@ -256,7 +255,6 @@ EXPECT_FALSE(security_info.sha1_in_chain); EXPECT_EQ(security_state::CONTENT_STATUS_NONE, security_info.mixed_content_status); - EXPECT_TRUE(security_info.sct_verify_statuses.empty()); EXPECT_FALSE(security_info.scheme_is_cryptographic); EXPECT_FALSE(net::IsCertStatusError(security_info.cert_status)); EXPECT_EQ(-1, security_info.security_bits); @@ -409,7 +407,6 @@ EXPECT_FALSE(security_info.sha1_in_chain); EXPECT_EQ(security_state::CONTENT_STATUS_NONE, security_info.mixed_content_status); - EXPECT_TRUE(security_info.sct_verify_statuses.empty()); EXPECT_FALSE(security_info.scheme_is_cryptographic); EXPECT_FALSE(net::IsCertStatusError(security_info.cert_status)); EXPECT_FALSE(!!security_info.certificate); @@ -1875,141 +1872,4 @@ observer.latest_explanations().info_explanations[0].description)); } -// After AddSCTUrlHandler() is called, requests to this hostname -// will be served with Signed Certificate Timestamps. -const char kMockHostnameWithSCTs[] = "example-scts.test"; - -// URLRequestJobWithSCTs mocks a connection that includes a set of dummy -// SCTs with these statuses. -const std::vector<net::ct::SCTVerifyStatus> kTestSCTStatuses{ - net::ct::SCT_STATUS_OK, net::ct::SCT_STATUS_LOG_UNKNOWN, - net::ct::SCT_STATUS_OK}; - -// A URLRequestMockHTTPJob that mocks a TLS connection with SCTs -// attached to it. The SCTs will have verification statuses -// |kTestSCTStatuses|. -class URLRequestJobWithSCTs : public net::URLRequestMockHTTPJob { - public: - URLRequestJobWithSCTs(net::URLRequest* request, - net::NetworkDelegate* network_delegate, - const base::FilePath& file_path, - scoped_refptr<net::X509Certificate> cert, - scoped_refptr<base::TaskRunner> task_runner) - : net::URLRequestMockHTTPJob(request, - network_delegate, - file_path, - task_runner), - cert_(std::move(cert)) {} - - void GetResponseInfo(net::HttpResponseInfo* info) override { - net::URLRequestMockHTTPJob::GetResponseInfo(info); - for (const auto& status : kTestSCTStatuses) { - scoped_refptr<net::ct::SignedCertificateTimestamp> dummy_sct = - new net::ct::SignedCertificateTimestamp(); - info->ssl_info.signed_certificate_timestamps.push_back( - net::SignedCertificateTimestampAndStatus(dummy_sct, status)); - } - info->ssl_info.cert = cert_; - } - - protected: - ~URLRequestJobWithSCTs() override {} - - private: - const scoped_refptr<net::X509Certificate> cert_; - - DISALLOW_COPY_AND_ASSIGN(URLRequestJobWithSCTs); -}; - -// A URLRequestInterceptor that handles requests with -// URLRequestJobWithSCTs jobs. -class URLRequestWithSCTsInterceptor : public net::URLRequestInterceptor { - public: - URLRequestWithSCTsInterceptor( - const base::FilePath& base_path, - scoped_refptr<base::SequencedWorkerPool> worker_pool, - scoped_refptr<net::X509Certificate> cert) - : base_path_(base_path), - worker_pool_(std::move(worker_pool)), - cert_(std::move(cert)) {} - - ~URLRequestWithSCTsInterceptor() override {} - - // net::URLRequestInterceptor: - net::URLRequestJob* MaybeInterceptRequest( - net::URLRequest* request, - net::NetworkDelegate* network_delegate) const override { - return new URLRequestJobWithSCTs( - request, network_delegate, base_path_, cert_, - worker_pool_->GetTaskRunnerWithShutdownBehavior( - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); - } - - private: - const base::FilePath base_path_; - const scoped_refptr<base::SequencedWorkerPool> worker_pool_; - const scoped_refptr<net::X509Certificate> cert_; - - DISALLOW_COPY_AND_ASSIGN(URLRequestWithSCTsInterceptor); -}; - -// Installs a handler to serve HTTPS requests to |kMockHostnameWithSCTs| -// with connections that have SCTs. -void AddSCTUrlHandler(const base::FilePath& base_path, - scoped_refptr<net::X509Certificate> cert, - scoped_refptr<base::SequencedWorkerPool> worker_pool) { - net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance(); - filter->AddHostnameInterceptor( - "https", kMockHostnameWithSCTs, - std::unique_ptr<net::URLRequestInterceptor>( - new URLRequestWithSCTsInterceptor(base_path, worker_pool, cert))); -} - -class BrowserTestURLRequestWithSCTs : public InProcessBrowserTest { - public: - BrowserTestURLRequestWithSCTs() : InProcessBrowserTest(), cert_(nullptr) {} - - void SetUpInProcessBrowserTestFixture() override { - cert_ = - net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); - ASSERT_TRUE(cert_); - } - - void SetUpOnMainThread() override { - base::FilePath serve_file; - PathService::Get(chrome::DIR_TEST_DATA, &serve_file); - serve_file = serve_file.Append(FILE_PATH_LITERAL("title1.html")); - content::BrowserThread::PostTask( - content::BrowserThread::IO, FROM_HERE, - base::Bind( - &AddSCTUrlHandler, serve_file, cert_, - make_scoped_refptr(content::BrowserThread::GetBlockingPool()))); - } - - private: - scoped_refptr<net::X509Certificate> cert_; - - DISALLOW_COPY_AND_ASSIGN(BrowserTestURLRequestWithSCTs); -}; - -// Tests that, when Signed Certificate Timestamps (SCTs) are served on a -// connection, the SCTs verification statuses are exposed on the -// SecurityInfo. -IN_PROC_BROWSER_TEST_F(BrowserTestURLRequestWithSCTs, - SecurityInfoWithSCTsAttached) { - ui_test_utils::NavigateToURL( - browser(), GURL(std::string("https://") + kMockHostnameWithSCTs)); - - content::WebContents* web_contents = - browser()->tab_strip_model()->GetActiveWebContents(); - ASSERT_TRUE(web_contents); - SecurityStateTabHelper* helper = - SecurityStateTabHelper::FromWebContents(web_contents); - ASSERT_TRUE(helper); - security_state::SecurityInfo security_info; - helper->GetSecurityInfo(&security_info); - EXPECT_EQ(security_state::SECURE, security_info.security_level); - EXPECT_EQ(kTestSCTStatuses, security_info.sct_verify_statuses); -} - } // namespace
diff --git a/chrome/browser/ui/ash/launcher/settings_window_observer.cc b/chrome/browser/ui/ash/launcher/settings_window_observer.cc index 1594319..c7fa01a 100644 --- a/chrome/browser/ui/ash/launcher/settings_window_observer.cc +++ b/chrome/browser/ui/ash/launcher/settings_window_observer.cc
@@ -7,12 +7,10 @@ #include "ash/public/cpp/shelf_item.h" #include "ash/public/cpp/window_properties.h" #include "ash/resources/grit/ash_resources.h" -#include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/settings_window_manager.h" -#include "chrome/common/chrome_features.h" #include "components/strings/grit/components_strings.h" #include "services/ui/public/interfaces/window_manager.mojom.h" #include "ui/aura/client/aura_constants.h" @@ -56,11 +54,9 @@ window->SetTitle(l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE)); window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - gfx::ImageSkia* icon = - base::FeatureList::IsEnabled(features::kMaterialDesignSettings) - ? rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_MD_SETTINGS) - : rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_SETTINGS); // The new gfx::ImageSkia instance is owned by the window itself. - window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); + window->SetProperty( + aura::client::kWindowIconKey, + new gfx::ImageSkia(*rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_SETTINGS))); aura_window_tracker_->Add(window); }
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index 389e0db1..1be6241 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -138,6 +138,7 @@ void OmniboxViewViews::Init() { set_controller(this); SetTextInputType(ui::TEXT_INPUT_TYPE_URL); + GetRenderText()->SetElideBehavior(gfx::ELIDE_TAIL); if (popup_window_mode_) SetReadOnly(true); @@ -761,6 +762,8 @@ saved_selection_for_focus_change_ = gfx::Range::InvalidRange(); } + GetRenderText()->SetElideBehavior(gfx::NO_ELIDE); + // Focus changes can affect the visibility of any keyword hint. if (model()->is_keyword_hint()) location_bar_view_->Layout(); @@ -789,6 +792,8 @@ // Make sure the beginning of the text is visible. SelectRange(gfx::Range(0)); + GetRenderText()->SetElideBehavior(gfx::ELIDE_TAIL); + // Focus changes can affect the visibility of any keyword hint. if (model()->is_keyword_hint()) location_bar_view_->Layout();
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc index 91b12dd6..048cff7 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
@@ -393,3 +393,17 @@ EXPECT_EQ(static_cast<ui::TextInputClient*>(omnibox_view_views), input_method->GetTextInputClient()); } + +IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, TextElideStatus) { + OmniboxView* view = nullptr; + ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); + OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); + + ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); + EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(), + gfx::ELIDE_TAIL); + + chrome::FocusLocationBar(browser()); + EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(), + gfx::NO_ELIDE); +}
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc index d0c10544..d857a94 100644 --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -204,9 +204,11 @@ locale); } - // TODO(mathp): Display global error message. - if (!credit_card.IsValid()) + // TODO(crbug.com/711365): Display global error message. + if (autofill::GetCompletionStatusForCard(credit_card, locale) != + autofill::CREDIT_CARD_COMPLETE) { return false; + } if (!credit_card_to_edit_) { // Add the card (will not add a duplicate).
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc index 828fd2e..2a2aea5 100644 --- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
@@ -25,6 +25,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/paint_vector_icon.h" +#include "ui/native_theme/native_theme.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/box_layout.h" @@ -82,11 +83,23 @@ views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); card_info_container->SetLayoutManager(box_layout.release()); - card_info_container->AddChildView(new views::Label(instrument_->label())); - card_info_container->AddChildView( - new views::Label(instrument_->sublabel())); - // TODO(anthonyvd): Add the "card is incomplete" label once the - // completedness logic is implemented. + if (!instrument_->label().empty()) + card_info_container->AddChildView(new views::Label(instrument_->label())); + if (!instrument_->sublabel().empty()) { + card_info_container->AddChildView( + new views::Label(instrument_->sublabel())); + } + if (!instrument_->IsCompleteForPayment()) { + std::unique_ptr<views::Label> missing_info_label = + base::MakeUnique<views::Label>(instrument_->GetMissingInfoLabel()); + missing_info_label->SetFontList( + missing_info_label->GetDefaultFontList().DeriveWithSizeDelta(-1)); + missing_info_label->SetEnabledColor( + missing_info_label->GetNativeTheme()->GetSystemColor( + ui::NativeTheme::kColorId_LinkEnabled)); + card_info_container->AddChildView(missing_info_label.release()); + } + return card_info_container; }
diff --git a/chrome/browser/ui/webui/local_state/local_state_ui.cc b/chrome/browser/ui/webui/local_state/local_state_ui.cc index 0ebad38..1676ea7 100644 --- a/chrome/browser/ui/webui/local_state/local_state_ui.cc +++ b/chrome/browser/ui/webui/local_state/local_state_ui.cc
@@ -62,7 +62,8 @@ void LocalStateUIHandler::HandleRequestJson(const base::ListValue* args) { std::unique_ptr<base::DictionaryValue> local_state_values( - g_browser_process->local_state()->GetPreferenceValuesOmitDefaults()); + g_browser_process->local_state()->GetPreferenceValues( + PrefService::EXCLUDE_DEFAULTS)); if (ENABLE_FILTERING) { std::vector<std::string> whitelisted_prefixes = { "variations", "user_experience_metrics", "uninstall_metrics"};
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index a6ab0c5..393ef9d 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -369,8 +369,17 @@ static const base::StringPiece guest_tab_html( ResourceBundle::GetSharedInstance().GetRawDataResource(guest_tab_ids)); +#if defined(OS_CHROMEOS) + // TODO(dbeam): convert c/b/resources/chromeos/guest_session_tab.html from + // i18n-* to $i18n{}. std::string full_html = webui::GetI18nTemplateHtml( guest_tab_html, &localized_strings); +#else + ui::TemplateReplacements replacements; + ui::TemplateReplacementsFromDictionaryValue(localized_strings, &replacements); + std::string full_html = + ui::ReplaceTemplateExpressions(guest_tab_html, replacements); +#endif new_tab_guest_html_ = base::RefCountedString::TakeString(&full_html); }
diff --git a/chrome/browser/ui/webui/prefs_internals_source.cc b/chrome/browser/ui/webui/prefs_internals_source.cc index a8606d0..9d30d11 100644 --- a/chrome/browser/ui/webui/prefs_internals_source.cc +++ b/chrome/browser/ui/webui/prefs_internals_source.cc
@@ -34,7 +34,7 @@ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); std::string json; std::unique_ptr<base::DictionaryValue> prefs = - profile_->GetPrefs()->GetPreferenceValues(); + profile_->GetPrefs()->GetPreferenceValues(PrefService::INCLUDE_DEFAULTS); DCHECK(prefs); CHECK(base::JSONWriter::WriteWithOptions( *prefs, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json));
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index 840baf2..0eeac1b2 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc
@@ -262,20 +262,6 @@ check_for_duplicates ? WorkItem::CHECK_DUPLICATES : WorkItem::ALWAYS_MOVE); - // Notify the shell of renaming the folder. This is for fixing an issue that - // the temp folder (e.g., "\Temp\source30163_39131\Chrome-bin\...") shows up - // in the callstack backtrace. (https://crbug.com/710698) - install_list->AddCallbackWorkItem(base::Bind( - [](const base::FilePath& src, const base::FilePath& target, - const CallbackWorkItem& work_item) { - if (!work_item.IsRollback()) { - SHChangeNotify(SHCNE_RENAMEFOLDER, SHCNF_PATH | SHCNF_FLUSHNOWAIT, - src.value().c_str(), target.value().c_str()); - } - return true; - }, - src_path, target_path)); - // Delete any old_chrome.exe if present (ignore failure if it's in use). install_list ->AddDeleteTreeWorkItem(target_path.Append(installer::kChromeOldExe),
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeInstrumentationTestRunner.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeInstrumentationTestRunner.java index 8303e01..349ef34 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeInstrumentationTestRunner.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeInstrumentationTestRunner.java
@@ -13,6 +13,7 @@ import com.google.android.gms.common.GoogleApiAvailability; import org.chromium.base.ThreadUtils; +import org.chromium.base.test.BaseChromiumInstrumentationTestRunner; import org.chromium.base.test.BaseTestResult; import org.chromium.base.test.util.DisableIfSkipCheck; import org.chromium.base.test.util.RestrictionSkipCheck; @@ -21,7 +22,7 @@ import org.chromium.chrome.browser.vr_shell.VrDaydreamApi; import org.chromium.chrome.test.util.ChromeDisableIf; import org.chromium.chrome.test.util.ChromeRestriction; -import org.chromium.content.browser.test.ContentInstrumentationTestRunner; +import org.chromium.content.browser.test.ChildProcessAllocatorSettingsHook; import org.chromium.policy.test.annotations.Policies; import org.chromium.ui.base.DeviceFormFactor; @@ -36,9 +37,7 @@ * An Instrumentation test runner that optionally spawns a test HTTP server. * The server's root directory is the device's external storage directory. */ -public class ChromeInstrumentationTestRunner extends ContentInstrumentationTestRunner { - private static final String TAG = "ChromeInstrumentationTestRunner"; - +public class ChromeInstrumentationTestRunner extends BaseChromiumInstrumentationTestRunner { @Override public void onCreate(Bundle arguments) { super.onCreate(arguments); @@ -51,6 +50,7 @@ result.addSkipCheck(new ChromeDisableIfSkipCheck(getTargetContext())); result.addPreTestHook(Policies.getRegistrationHook()); + result.addPreTestHook(new ChildProcessAllocatorSettingsHook()); } static class ChromeRestrictionSkipCheck extends RestrictionSkipCheck {
diff --git a/chrome/test/data/extensions/api_test/native_bindings/platform_app/main.js b/chrome/test/data/extensions/api_test/native_bindings/platform_app/main.js index 665fa63b4..f0f8d6d5 100644 --- a/chrome/test/data/extensions/api_test/native_bindings/platform_app/main.js +++ b/chrome/test/data/extensions/api_test/native_bindings/platform_app/main.js
@@ -10,6 +10,7 @@ }, function testCurrentWindow() { var currentWindow = chrome.app.window.current(); + chrome.test.assertTrue(currentWindow.contentWindow == window); // Current window is pretty funny and has a ton of custom JS bindings, also // utilizing an internal API (currentWindowInternal). Test a bunch of stuff. chrome.test.assertTrue(!!currentWindow, 'currentWindow');
diff --git a/chrome/test/data/extensions/api_test/native_bindings/platform_app/test.js b/chrome/test/data/extensions/api_test/native_bindings/platform_app/test.js index 40a8908..a55c2887 100644 --- a/chrome/test/data/extensions/api_test/native_bindings/platform_app/test.js +++ b/chrome/test/data/extensions/api_test/native_bindings/platform_app/test.js
@@ -2,6 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +var appWindow; + chrome.app.runtime.onLaunched.addListener(function() { - chrome.app.window.create('main.html', {}, function () {}); + chrome.app.window.create('main.html', {}, function (win) {appWindow = win}); +}); + +chrome.test.sendMessage('ready', function() { + try { + // The onClosed event is dispatched by a call to the internal + // onAppWindowClosed method in the app.window custom bindings. Getting this + // event signals that we can call into methods of custom bindings modules + // for APIs. + appWindow.onClosed.addListener(function() { + chrome.test.sendMessage('success'); + }); + appWindow.close(); + } catch (e) { + chrome.test.sendMessage('failure: ' + e); + } });
diff --git a/chrome/test/data/webui/extensions/extension_shortcut_input_test.js b/chrome/test/data/webui/extensions/extension_shortcut_input_test.js index e33f6b6..f16291d 100644 --- a/chrome/test/data/webui/extensions/extension_shortcut_input_test.js +++ b/chrome/test/data/webui/extensions/extension_shortcut_input_test.js
@@ -24,8 +24,8 @@ test(assert(TestNames.Basic), function() { var field = input.$['input']; - var fieldText = function() { return field.textContent.trim(); }; - expectEquals('Not set', fieldText()); + var fieldText = function() { return field.value; }; + expectEquals('', fieldText()); var isClearVisible = extension_test_util.isVisible.bind( null, input, '#clear', false); expectFalse(isClearVisible()); @@ -37,7 +37,7 @@ MockInteractions.tap(field); startCaptureListener.verify(); } - expectEquals('Type a shortcut', fieldText()); + expectEquals('', fieldText()); expectTrue(input.capturing_); expectFalse(isClearVisible());
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index 34fa868..55bb073 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -19,13 +19,15 @@ #include "components/safe_json/utility/safe_json_parser_mojo_impl.h" #include "content/public/common/content_switches.h" #include "content/public/common/service_info.h" +#include "content/public/common/service_manager_connection.h" +#include "content/public/common/simple_connection_filter.h" #include "content/public/utility/utility_thread.h" #include "courgette/courgette.h" #include "courgette/third_party/bsdiff/bsdiff.h" #include "extensions/features/features.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "printing/features/features.h" -#include "services/service_manager/public/cpp/interface_registry.h" +#include "services/service_manager/public/cpp/binder_registry.h" #include "third_party/zlib/google/zip.h" #if !defined(OS_ANDROID) @@ -244,6 +246,53 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUtilityProcessRunningElevated)) utility_process_running_elevated_ = true; + + auto registry = base::MakeUnique<service_manager::BinderRegistry>(); +#if BUILDFLAG(ENABLE_EXTENSIONS) + extensions::ExtensionsHandler::ExposeInterfacesToBrowser( + registry.get(), utility_process_running_elevated_); + extensions::utility_handler::ExposeInterfacesToBrowser( + registry.get(), utility_process_running_elevated_); +#endif + // If our process runs with elevated privileges, only add elevated Mojo + // interfaces to the interface registry. + if (!utility_process_running_elevated_) { + registry->AddInterface(base::Bind(&FilePatcherImpl::Create), + base::ThreadTaskRunnerHandle::Get()); +#if !defined(OS_ANDROID) + registry->AddInterface<net::interfaces::ProxyResolverFactory>( + base::Bind(CreateProxyResolverFactory), + base::ThreadTaskRunnerHandle::Get()); + registry->AddInterface(base::Bind(CreateResourceUsageReporter), + base::ThreadTaskRunnerHandle::Get()); + registry->AddInterface(base::Bind(&ProfileImportHandler::Create), + base::ThreadTaskRunnerHandle::Get()); + registry->AddInterface( + base::Bind(&media_router::DialDeviceDescriptionParserImpl::Create), + base::ThreadTaskRunnerHandle::Get()); +#endif // !defined(OS_ANDROID) + registry->AddInterface(base::Bind(&payments::PaymentManifestParser::Create), + base::ThreadTaskRunnerHandle::Get()); + registry->AddInterface( + base::Bind(&safe_json::SafeJsonParserMojoImpl::Create), + base::ThreadTaskRunnerHandle::Get()); +#if defined(OS_WIN) + registry->AddInterface(base::Bind(&ShellHandlerImpl::Create), + base::ThreadTaskRunnerHandle::Get()); +#endif +#if defined(OS_CHROMEOS) + registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create), + base::ThreadTaskRunnerHandle::Get()); +#endif +#if defined(FULL_SAFE_BROWSING) + registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create), + base::ThreadTaskRunnerHandle::Get()); +#endif + } + content::ChildThread::Get() + ->GetServiceManagerConnection() + ->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>( + std::move(registry))); } bool ChromeContentUtilityClient::OnMessageReceived( @@ -259,42 +308,6 @@ return false; } -void ChromeContentUtilityClient::ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry) { -#if BUILDFLAG(ENABLE_EXTENSIONS) - extensions::ExtensionsHandler::ExposeInterfacesToBrowser( - registry, utility_process_running_elevated_); - extensions::utility_handler::ExposeInterfacesToBrowser( - registry, utility_process_running_elevated_); -#endif - // If our process runs with elevated privileges, only add elevated Mojo - // interfaces to the interface registry. - if (utility_process_running_elevated_) - return; - - registry->AddInterface(base::Bind(&FilePatcherImpl::Create)); -#if !defined(OS_ANDROID) - registry->AddInterface<net::interfaces::ProxyResolverFactory>( - base::Bind(CreateProxyResolverFactory)); - registry->AddInterface(base::Bind(CreateResourceUsageReporter)); - registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); - registry->AddInterface( - base::Bind(&media_router::DialDeviceDescriptionParserImpl::Create)); -#endif // !defined(OS_ANDROID) - registry->AddInterface(base::Bind(&payments::PaymentManifestParser::Create)); - registry->AddInterface( - base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); -#if defined(OS_WIN) - registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); -#endif -#if defined(OS_CHROMEOS) - registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create)); -#endif -#if defined(FULL_SAFE_BROWSING) - registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create)); -#endif -} - // static void ChromeContentUtilityClient::PreSandboxStartup() { #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h index 49374cb..31a1ca66 100644 --- a/chrome/utility/chrome_content_utility_client.h +++ b/chrome/utility/chrome_content_utility_client.h
@@ -21,8 +21,6 @@ // content::ContentUtilityClient: void UtilityThreadStarted() override; bool OnMessageReceived(const IPC::Message& message) override; - void ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry) override; static void PreSandboxStartup();
diff --git a/chrome/utility/extensions/extensions_handler.cc b/chrome/utility/extensions/extensions_handler.cc index b1567175..819d390c 100644 --- a/chrome/utility/extensions/extensions_handler.cc +++ b/chrome/utility/extensions/extensions_handler.cc
@@ -20,7 +20,7 @@ #include "content/public/utility/utility_thread.h" #include "media/base/media.h" #include "mojo/public/cpp/bindings/strong_binding.h" -#include "services/service_manager/public/cpp/interface_registry.h" +#include "services/service_manager/public/cpp/binder_registry.h" #include "ui/base/ui_base_switches.h" #if !defined(MEDIA_DISABLE_FFMPEG) @@ -178,21 +178,25 @@ // static void ExtensionsHandler::ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry, + service_manager::BinderRegistry* registry, bool running_elevated) { // If our process runs with elevated privileges, only add elevated Mojo // interfaces to the interface registry. if (running_elevated) { #if defined(OS_WIN) - registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create)); - registry->AddInterface(base::Bind(&WiFiCredentialsGetterImpl::Create)); + registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create), + base::ThreadTaskRunnerHandle::Get()); + registry->AddInterface(base::Bind(&WiFiCredentialsGetterImpl::Create), + base::ThreadTaskRunnerHandle::Get()); #endif return; } - registry->AddInterface(base::Bind(&MediaParserImpl::Create)); + registry->AddInterface(base::Bind(&MediaParserImpl::Create), + base::ThreadTaskRunnerHandle::Get()); #if !defined(OS_WIN) - registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create)); + registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create), + base::ThreadTaskRunnerHandle::Get()); #endif }
diff --git a/chrome/utility/extensions/extensions_handler.h b/chrome/utility/extensions/extensions_handler.h index 9c3c6e0..6230fa8 100644 --- a/chrome/utility/extensions/extensions_handler.h +++ b/chrome/utility/extensions/extensions_handler.h
@@ -20,7 +20,7 @@ #endif namespace service_manager { -class InterfaceRegistry; +class BinderRegistry; } namespace extensions { @@ -36,7 +36,7 @@ static void PreSandboxStartup(); static void ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry, + service_manager::BinderRegistry* registry, bool running_elevated); // UtilityMessageHandler:
diff --git a/chromeos/dbus/services/proxy_resolution_service_provider.cc b/chromeos/dbus/services/proxy_resolution_service_provider.cc index 2400344..a5f6a78 100644 --- a/chromeos/dbus/services/proxy_resolution_service_provider.cc +++ b/chromeos/dbus/services/proxy_resolution_service_provider.cc
@@ -85,8 +85,12 @@ }; ProxyResolutionServiceProvider::ProxyResolutionServiceProvider( + const std::string& dbus_interface, + const std::string& dbus_method_name, std::unique_ptr<Delegate> delegate) - : delegate_(std::move(delegate)), + : dbus_interface_(dbus_interface), + dbus_method_name_(dbus_method_name), + delegate_(std::move(delegate)), origin_thread_(base::ThreadTaskRunnerHandle::Get()), weak_ptr_factory_(this) {} @@ -100,7 +104,7 @@ exported_object_ = exported_object; VLOG(1) << "ProxyResolutionServiceProvider started"; exported_object_->ExportMethod( - kLibCrosServiceInterface, kResolveNetworkProxy, + dbus_interface_, dbus_method_name_, base::Bind(&ProxyResolutionServiceProvider::ResolveProxy, weak_ptr_factory_.GetWeakPtr()), base::Bind(&ProxyResolutionServiceProvider::OnExported,
diff --git a/chromeos/dbus/services/proxy_resolution_service_provider.h b/chromeos/dbus/services/proxy_resolution_service_provider.h index cd89ce1..9c750d77 100644 --- a/chromeos/dbus/services/proxy_resolution_service_provider.h +++ b/chromeos/dbus/services/proxy_resolution_service_provider.h
@@ -80,7 +80,9 @@ virtual scoped_refptr<net::URLRequestContextGetter> GetRequestContext() = 0; }; - explicit ProxyResolutionServiceProvider(std::unique_ptr<Delegate> delegate); + ProxyResolutionServiceProvider(const std::string& dbus_interface, + const std::string& dbus_method_name, + std::unique_ptr<Delegate> delegate); ~ProxyResolutionServiceProvider() override; // CrosDBusService::ServiceProviderInterface: @@ -129,6 +131,8 @@ // information to the client over D-Bus. void NotifyProxyResolved(std::unique_ptr<Request> request); + const std::string dbus_interface_; + const std::string dbus_method_name_; std::unique_ptr<Delegate> delegate_; scoped_refptr<dbus::ExportedObject> exported_object_; scoped_refptr<base::SingleThreadTaskRunner> origin_thread_;
diff --git a/chromeos/dbus/services/proxy_resolution_service_provider_unittest.cc b/chromeos/dbus/services/proxy_resolution_service_provider_unittest.cc index ef2a0bcd..eadba7f 100644 --- a/chromeos/dbus/services/proxy_resolution_service_provider_unittest.cc +++ b/chromeos/dbus/services/proxy_resolution_service_provider_unittest.cc
@@ -17,6 +17,7 @@ #include "base/time/time.h" #include "chromeos/dbus/services/service_provider_test_helper.h" #include "dbus/message.h" +#include "dbus/object_path.h" #include "net/base/net_errors.h" #include "net/proxy/mock_proxy_resolver.h" #include "net/proxy/proxy_config_service_fixed.h" @@ -195,9 +196,13 @@ proxy_resolver_ = base::MakeUnique<TestProxyResolver>(network_thread_.task_runner()); service_provider_ = base::MakeUnique<ProxyResolutionServiceProvider>( + kNetworkProxyServiceInterface, kNetworkProxyServiceResolveProxyMethod, base::MakeUnique<TestDelegate>(network_thread_.task_runner(), proxy_resolver_.get())); - test_helper_.SetUp(kResolveNetworkProxy, service_provider_.get()); + test_helper_.SetUp( + kNetworkProxyServiceName, dbus::ObjectPath(kNetworkProxyServicePath), + kNetworkProxyServiceInterface, kNetworkProxyServiceResolveProxyMethod, + service_provider_.get()); } ~ProxyResolutionServiceProviderTest() override { @@ -248,7 +253,7 @@ EXPECT_TRUE(success); } - // Makes a D-Bus call to |service_provider_|'s ResolveNetworkProxy method. If + // Makes a D-Bus call to |service_provider_|'s ResolveProxy method. If // |request_signal| is true, requests that the proxy information be returned // via a signal; otherwise it should be included in the response. // |response_out| is updated to hold the response, and |signal_out| is updated @@ -257,8 +262,8 @@ bool request_signal, std::unique_ptr<dbus::Response>* response_out, std::unique_ptr<SignalInfo>* signal_out) { - dbus::MethodCall method_call(kLibCrosServiceInterface, - kResolveNetworkProxy); + dbus::MethodCall method_call(kNetworkProxyServiceInterface, + kNetworkProxyServiceResolveProxyMethod); dbus::MessageWriter writer(&method_call); writer.AppendString(source_url); if (request_signal) { @@ -266,8 +271,7 @@ writer.AppendString(kReturnSignalName); // Connect to the signal that will be sent to kReturnSignalInterface and - // kReturnSignalName. ResolveNetworkProxy() will send the result as a - // signal. OnSignalReceived() will be called upon the delivery. + // kReturnSignalName. test_helper_.SetUpReturnSignal( kReturnSignalInterface, kReturnSignalName, base::Bind(&ProxyResolutionServiceProviderTest::OnSignalReceived,
diff --git a/chromeos/dbus/services/service_provider_test_helper.cc b/chromeos/dbus/services/service_provider_test_helper.cc index 698fd39d..f463a65d 100644 --- a/chromeos/dbus/services/service_provider_test_helper.cc +++ b/chromeos/dbus/services/service_provider_test_helper.cc
@@ -10,7 +10,7 @@ #include "base/run_loop.h" #include "dbus/message.h" #include "dbus/mock_bus.h" -#include "third_party/cros_system_api/dbus/service_constants.h" +#include "dbus/object_path.h" using ::testing::_; using ::testing::AllOf; @@ -31,6 +31,9 @@ } void ServiceProviderTestHelper::SetUp( + const std::string& service_name, + const dbus::ObjectPath& service_path, + const std::string& interface_name, const std::string& exported_method_name, CrosDBusService::ServiceProviderInterface* service_provider) { // Create a mock bus. @@ -41,36 +44,31 @@ // ShutdownAndBlock() will be called in TearDown(). EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); - // Create a mock exported object that behaves as - // org.chromium.CrosDBusService. + // Create a mock exported object that behaves as the service. mock_exported_object_ = - new dbus::MockExportedObject(mock_bus_.get(), - dbus::ObjectPath(kLibCrosServicePath)); + new dbus::MockExportedObject(mock_bus_.get(), service_path); // |mock_exported_object_|'s ExportMethod() will use // |MockExportedObject(). - EXPECT_CALL( - *mock_exported_object_.get(), - ExportMethod(kLibCrosServiceInterface, exported_method_name, _, _)) + EXPECT_CALL(*mock_exported_object_.get(), + ExportMethod(interface_name, exported_method_name, _, _)) .WillOnce(Invoke(this, &ServiceProviderTestHelper::MockExportMethod)); // Create a mock object proxy, with which we call a method of // |mock_exported_object_|. mock_object_proxy_ = - new dbus::MockObjectProxy(mock_bus_.get(), - kLibCrosServiceName, - dbus::ObjectPath(kLibCrosServicePath)); + new dbus::MockObjectProxy(mock_bus_.get(), service_name, service_path); // |mock_object_proxy_|'s MockCallMethodAndBlock() will use // MockCallMethodAndBlock() to return responses. EXPECT_CALL(*mock_object_proxy_.get(), MockCallMethodAndBlock( AllOf(ResultOf(std::mem_fun(&dbus::MethodCall::GetInterface), - kLibCrosServiceInterface), + interface_name), ResultOf(std::mem_fun(&dbus::MethodCall::GetMember), exported_method_name)), _)) .WillOnce( - Invoke(this, &ServiceProviderTestHelper::MockCallMethodAndBlock)); + Invoke(this, &ServiceProviderTestHelper::MockCallMethodAndBlock)); service_provider->Start(mock_exported_object_.get()); }
diff --git a/chromeos/dbus/services/service_provider_test_helper.h b/chromeos/dbus/services/service_provider_test_helper.h index 69928f5..e6429cdc 100644 --- a/chromeos/dbus/services/service_provider_test_helper.h +++ b/chromeos/dbus/services/service_provider_test_helper.h
@@ -18,6 +18,7 @@ namespace dbus { class MockBus; +class ObjectPath; } // namespace dbus @@ -40,7 +41,10 @@ ~ServiceProviderTestHelper(); // Sets up helper. Should be called before |CallMethod()|. - void SetUp(const std::string& exported_method_name, + void SetUp(const std::string& service_name, + const dbus::ObjectPath& service_path, + const std::string& interface_name, + const std::string& exported_method_name, CrosDBusService::ServiceProviderInterface* service_provider); // Setups return signal callback. It's optional and don't need to be called
diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc index e7237f7..e694431 100644 --- a/components/autofill/core/browser/validation.cc +++ b/components/autofill/core/browser/validation.cc
@@ -125,6 +125,43 @@ return false; } +CreditCardCompletionStatus GetCompletionStatusForCard( + const CreditCard& card, + const std::string& app_locale) { + CreditCardCompletionStatus status = CREDIT_CARD_COMPLETE; + if (card.IsExpired(autofill::AutofillClock::Now())) + status |= CREDIT_CARD_EXPIRED; + + if (card.number().empty()) + status |= CREDIT_CARD_NO_NUMBER; + + if (card.GetInfo(autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL), + app_locale) + .empty()) { + status |= CREDIT_CARD_NO_CARDHOLDER; + } + + return status; +} + +base::string16 GetCompletionMessageForCard(CreditCardCompletionStatus status) { + switch (status) { + case CREDIT_CARD_COMPLETE: + return base::string16(); + case CREDIT_CARD_EXPIRED: + return l10n_util::GetStringUTF16( + IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED); + case CREDIT_CARD_NO_CARDHOLDER: + return l10n_util::GetStringUTF16(IDS_PAYMENTS_NAME_ON_CARD_REQUIRED); + case CREDIT_CARD_NO_NUMBER: + return l10n_util::GetStringUTF16( + IDS_PAYMENTS_CARD_NUMBER_INVALID_VALIDATION_MESSAGE); + default: + // Multiple things are missing + return l10n_util::GetStringUTF16(IDS_PAYMENTS_MORE_INFORMATION_REQUIRED); + } +} + bool IsValidEmailAddress(const base::string16& text) { // E-Mail pattern as defined by the WhatWG. (4.10.7.1.5 E-Mail state) const base::string16 kEmailPattern = base::ASCIIToUTF16(
diff --git a/components/autofill/core/browser/validation.h b/components/autofill/core/browser/validation.h index 93a52e59..5905b84 100644 --- a/components/autofill/core/browser/validation.h +++ b/components/autofill/core/browser/validation.h
@@ -15,10 +15,19 @@ namespace autofill { +class CreditCard; + // Constants for the length of a CVC. static const size_t GENERAL_CVC_LENGTH = 3; static const size_t AMEX_CVC_LENGTH = 4; +// Used to express the completion status of a credit card. +typedef uint32_t CreditCardCompletionStatus; +static const CreditCardCompletionStatus CREDIT_CARD_COMPLETE = 0; +static const CreditCardCompletionStatus CREDIT_CARD_EXPIRED = 1 << 0; +static const CreditCardCompletionStatus CREDIT_CARD_NO_CARDHOLDER = 1 << 1; +static const CreditCardCompletionStatus CREDIT_CARD_NO_NUMBER = 1 << 2; + // Returns true if |year| and |month| describe a date later than |now|. // |year| must have 4 digits. bool IsValidCreditCardExpirationDate(int year, @@ -42,6 +51,18 @@ const std::set<std::string>& supported_basic_card_networks, base::string16* error_message); +// Returns the credit card's completion status. If equal to +// CREDIT_CARD_COMPLETE, then the card is ready to be used for Payment Request. +// TODO(crbug.com/709776): Check for billing address association. +CreditCardCompletionStatus GetCompletionStatusForCard( + const CreditCard& credit_card, + const std::string& app_locale); + +// Return the message to be displayed to the user, indicating what's missing +// to make the credit card complete for payment. If more than one thing is +// missing, the message will be a generic "more information required". +base::string16 GetCompletionMessageForCard(CreditCardCompletionStatus status); + // Returns true if |text| looks like a valid e-mail address. bool IsValidEmailAddress(const base::string16& text);
diff --git a/components/chrome_cleaner/public/constants/BUILD.gn b/components/chrome_cleaner/public/constants/BUILD.gn new file mode 100644 index 0000000..826ffa6c --- /dev/null +++ b/components/chrome_cleaner/public/constants/BUILD.gn
@@ -0,0 +1,10 @@ +# Copyright 2017 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("constants") { + sources = [ + "constants.cc", + "constants.h", + ] +}
diff --git a/components/chrome_cleaner/public/constants/constants.cc b/components/chrome_cleaner/public/constants/constants.cc new file mode 100644 index 0000000..6aae97e --- /dev/null +++ b/components/chrome_cleaner/public/constants/constants.cc
@@ -0,0 +1,41 @@ +// Copyright 2017 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 "components/chrome_cleaner/public/constants/constants.h" + +namespace chrome_cleaner { + +// Command line switches. +const char kChromeChannelSwitch[] = "chrome-channel"; +const char kChromeExePathSwitch[] = "chrome-exe-path"; +const char kChromeMojoPipeTokenSwitch[] = "chrome-mojo-pipe-token"; +const char kChromePromptSwitch[] = "chrome-prompt"; +const char kChromeSystemInstallSwitch[] = "chrome-system-install"; +const char kChromeVersionSwitch[] = "chrome-version"; +const char kEnableCrashReportingSwitch[] = "enable-crash-reporting"; +const char kExtendedSafeBrowsingEnabledSwitch[] = + "extended-safebrowsing-enabled"; +const char kSessionIdSwitch[] = "session-id"; +const char kUmaUserSwitch[] = "uma-user"; + +// Registry paths and subkeys. +const wchar_t kSoftwareRemovalToolRegistryKey[] = + L"Software\\Google\\Software Removal Tool"; +const wchar_t kCleanerSubKey[] = L"Cleaner"; +const wchar_t kScanTimesSubKey[] = L"ScanTimes"; + +// Registry value names. +const wchar_t kEndTimeValueName[] = L"EndTime"; +const wchar_t kEngineErrorCodeValueName[] = L"EngineErrorCode"; +const wchar_t kExitCodeValueName[] = L"ExitCode"; +// Note: the lowercase "s" in "Uws" can't be fixed due to compatibility with +// older versions. +const wchar_t kFoundUwsValueName[] = L"FoundUws"; +const wchar_t kLogsUploadResultValueName[] = L"LogsUploadResult"; +const wchar_t kMemoryUsedValueName[] = L"MemoryUsed"; +const wchar_t kStartTimeValueName[] = L"StartTime"; +const wchar_t kUploadResultsValueName[] = L"UploadResults"; +const wchar_t kVersionValueName[] = L"Version"; + +} // namespace chrome_cleaner
diff --git a/components/chrome_cleaner/public/constants/constants.h b/components/chrome_cleaner/public/constants/constants.h new file mode 100644 index 0000000..03cd6ae --- /dev/null +++ b/components/chrome_cleaner/public/constants/constants.h
@@ -0,0 +1,90 @@ +// Copyright 2017 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 COMPONENTS_CHROME_CLEANER_PUBLIC_CONSTANTS_CONSTANTS_H_ +#define COMPONENTS_CHROME_CLEANER_PUBLIC_CONSTANTS_CONSTANTS_H_ + +// Constants shared by the Chromium and the Chrome Cleanaup tool repos. + +namespace chrome_cleaner { + +// Switches sent from Chrome to either the Software Reporter or the Chrome +// Cleanup tool. + +// The current Chrome channel. The value of this flag is an integer with values +// according to version_info::Channel enum. +extern const char kChromeChannelSwitch[]; + +// The path to Chrome's executable. +extern const char kChromeExePathSwitch[]; + +// The Mojo pipe token for IPC communication between the Software Reporter and +// Chrome. +extern const char kChromeMojoPipeTokenSwitch[]; + +// Indicates that a cleaner run was started by Chrome. +extern const char kChromePromptSwitch[]; + +// Indicates that the current Chrome installation was a system-level +// installation. +extern const char kChromeSystemInstallSwitch[]; + +// The Chrome version string. +extern const char kChromeVersionSwitch[]; + +// Indicates that crash reporting is enabled for the current user. +extern const char kEnableCrashReportingSwitch[]; + +// Indicates that the current user opted into Safe Browsing Extended Reporting. +extern const char kExtendedSafeBrowsingEnabledSwitch[]; + +// Identifier used to group all reports generated during the same run of the +// software reporter (which may include multiple invocations of the reporter +/// binary, each generating a report). An ASCII, base-64 encoded random string. +extern const char kSessionIdSwitch[]; + +// Indicates that metrics reporting is enabled for the current user. +extern const char kUmaUserSwitch[]; + +// Registry paths where the reporter and the cleaner will write metrics data +// to be reported by Chrome. + +// TODO(b/647763) Change the registry key to properly handle cases when the +// user runs Google Chrome stable alongside Google Chrome SxS. +extern const wchar_t kSoftwareRemovalToolRegistryKey[]; + +// The suffix for the registry key where cleaner metrics are written to. +extern const wchar_t kCleanerSubKey[]; +// The suffix for registry key paths where scan times will be written to. +extern const wchar_t kScanTimesSubKey[]; + +// Registry value names where metrics are written to. +extern const wchar_t kEndTimeValueName[]; +extern const wchar_t kEngineErrorCodeValueName[]; +extern const wchar_t kExitCodeValueName[]; +extern const wchar_t kFoundUwsValueName[]; +extern const wchar_t kLogsUploadResultValueName[]; +extern const wchar_t kMemoryUsedValueName[]; +extern const wchar_t kStartTimeValueName[]; +extern const wchar_t kUploadResultsValueName[]; +extern const wchar_t kVersionValueName[]; + +// Exit codes from the Software Reporter process identified by Chrome. +constexpr int kSwReporterCleanupNeeded = 0; +constexpr int kSwReporterNothingFound = 2; +constexpr int kSwReporterPostRebootCleanupNeeded = 4; +constexpr int kSwReporterDelayedPostRebootCleanupNeeded = 15; + +// Values to be passed to the kChromePromptSwitch of the Chrome Cleanup Tool to +// indicate how the user interacted with the accept button. +enum class ChromePromptValue { + // The user accepted the prompt when the prompt was first shown. + kPrompted = 3, + // The user accepted the prompt after navigating to it from the menu. + kShownFromMenu = 4 +}; + +} // namespace chrome_cleaner + +#endif // COMPONENTS_CHROME_CLEANER_PUBLIC_CONSTANTS_CONSTANTS_H_
diff --git a/components/exo/pointer.cc b/components/exo/pointer.cc index 35d1e77..e650b4f 100644 --- a/components/exo/pointer.cc +++ b/components/exo/pointer.cc
@@ -358,7 +358,7 @@ // TODO(reveman): Add interface for creating cursors from GpuMemoryBuffers // and use that here instead of the current bitmap API. crbug.com/686600 platform_cursor = ui::CursorFactoryOzone::GetInstance()->CreateImageCursor( - *bitmap.get(), hotspot); + *bitmap.get(), hotspot, cursor_scale_); #elif defined(USE_X11) XcursorImage* image = ui::SkBitmapToXcursorImage(bitmap.get(), hotspot); platform_cursor = ui::CreateReffedCustomXCursor(image);
diff --git a/components/minidump_uploader/android/javatests/src/org/chromium/components/minidump_uploader/MinidumpUploadCallableTest.java b/components/minidump_uploader/android/javatests/src/org/chromium/components/minidump_uploader/MinidumpUploadCallableTest.java index 52f2b3f..ec0845f6 100644 --- a/components/minidump_uploader/android/javatests/src/org/chromium/components/minidump_uploader/MinidumpUploadCallableTest.java +++ b/components/minidump_uploader/android/javatests/src/org/chromium/components/minidump_uploader/MinidumpUploadCallableTest.java
@@ -15,8 +15,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; @@ -404,18 +402,6 @@ assertTrue(mExpectedFileAfterUpload.exists()); } - private void extendUploadFile(int numBytes) throws FileNotFoundException, IOException { - FileOutputStream stream = null; - try { - stream = new FileOutputStream(mTestUpload, true); - byte[] buf = new byte[numBytes]; - stream.write(buf); - stream.flush(); - } finally { - if (stream != null) stream.close(); - } - } - @SmallTest @Feature({"Android-AppBase"}) public void testReceivingErrorCodes() throws Exception {
diff --git a/components/payments/core/BUILD.gn b/components/payments/core/BUILD.gn index 1892be2..0a8ca3b 100644 --- a/components/payments/core/BUILD.gn +++ b/components/payments/core/BUILD.gn
@@ -67,10 +67,12 @@ "//components/autofill/core/browser", "//components/autofill/core/browser:test_support", "//components/metrics/proto", + "//components/strings:components_strings_grit", "//components/ukm", "//components/ukm:test_support", "//testing/gmock", "//testing/gtest", "//third_party/libaddressinput:test_support", + "//ui/base", ] }
diff --git a/components/payments/core/autofill_payment_instrument.cc b/components/payments/core/autofill_payment_instrument.cc index 398edb7..04017e4 100644 --- a/components/payments/core/autofill_payment_instrument.cc +++ b/components/payments/core/autofill_payment_instrument.cc
@@ -10,6 +10,7 @@ #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_type.h" #include "components/autofill/core/browser/field_types.h" +#include "components/autofill/core/browser/validation.h" #include "components/autofill/core/common/autofill_clock.h" #include "components/payments/core/basic_card_response.h" #include "components/payments/core/payment_request_data_util.h" @@ -17,20 +18,6 @@ namespace payments { -namespace { - -// Returns whether |card| has a non-empty number and cardholder name. Server -// cards will have a non-empty number. -bool CreditCardHasNumberAndName(const autofill::CreditCard& card, - const std::string& app_locale) { - return !card.number().empty() && - !card.GetInfo(autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL), - app_locale) - .empty(); -} - -} // namespace - AutofillPaymentInstrument::AutofillPaymentInstrument( const std::string& method_name, const autofill::CreditCard& card, @@ -68,16 +55,22 @@ } bool AutofillPaymentInstrument::IsCompleteForPayment() { - // A card is complete for payment if it's not expired, its number is not - // empty (a server card fills this condition) and there is a cardholder name. - // TODO(crbug.com/709776): Check for billing address association. - return !credit_card_.IsExpired(autofill::AutofillClock::Now()) && - CreditCardHasNumberAndName(credit_card_, app_locale_); + return autofill::GetCompletionStatusForCard(credit_card_, app_locale_) == + autofill::CREDIT_CARD_COMPLETE; +} + +base::string16 AutofillPaymentInstrument::GetMissingInfoLabel() { + return autofill::GetCompletionMessageForCard( + autofill::GetCompletionStatusForCard(credit_card_, app_locale_)); } bool AutofillPaymentInstrument::IsValidForCanMakePayment() { - // An expired card is still valid for the purposes of canMakePayment. - return CreditCardHasNumberAndName(credit_card_, app_locale_); + autofill::CreditCardCompletionStatus status = + autofill::GetCompletionStatusForCard(credit_card_, app_locale_); + // Card has to have a cardholder name and number for the purposes of + // CanMakePayment. An expired card is still valid at this stage. + return !(status & autofill::CREDIT_CARD_NO_CARDHOLDER || + status & autofill::CREDIT_CARD_NO_NUMBER); } void AutofillPaymentInstrument::OnFullCardRequestSucceeded(
diff --git a/components/payments/core/autofill_payment_instrument.h b/components/payments/core/autofill_payment_instrument.h index 84b343a..c0e49215 100644 --- a/components/payments/core/autofill_payment_instrument.h +++ b/components/payments/core/autofill_payment_instrument.h
@@ -41,6 +41,7 @@ // PaymentInstrument: void InvokePaymentApp(PaymentInstrument::Delegate* delegate) override; bool IsCompleteForPayment() override; + base::string16 GetMissingInfoLabel() override; bool IsValidForCanMakePayment() override; // autofill::payments::FullCardRequest::ResultDelegate:
diff --git a/components/payments/core/autofill_payment_instrument_unittest.cc b/components/payments/core/autofill_payment_instrument_unittest.cc index 7b9db0b..622a4e9 100644 --- a/components/payments/core/autofill_payment_instrument_unittest.cc +++ b/components/payments/core/autofill_payment_instrument_unittest.cc
@@ -5,11 +5,14 @@ #include "components/payments/core/autofill_payment_instrument.h" #include "base/macros.h" +#include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/credit_card.h" +#include "components/strings/grit/components_strings.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/l10n/l10n_util.h" namespace payments { @@ -40,6 +43,7 @@ AutofillPaymentInstrument instrument("visa", local_credit_card(), billing_profiles(), "en-US", nullptr); EXPECT_TRUE(instrument.IsCompleteForPayment()); + EXPECT_TRUE(instrument.GetMissingInfoLabel().empty()); } // An expired local card is not a valid instrument for payment. @@ -49,6 +53,9 @@ AutofillPaymentInstrument instrument("visa", card, billing_profiles(), "en-US", nullptr); EXPECT_FALSE(instrument.IsCompleteForPayment()); + EXPECT_EQ(l10n_util::GetStringUTF16( + IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED), + instrument.GetMissingInfoLabel()); } // A local card with no name is not a valid instrument for payment. @@ -56,18 +63,40 @@ autofill::CreditCard& card = local_credit_card(); card.SetInfo(autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL), base::ASCIIToUTF16(""), "en-US"); + base::string16 missing_info; AutofillPaymentInstrument instrument("visa", card, billing_profiles(), "en-US", nullptr); EXPECT_FALSE(instrument.IsCompleteForPayment()); + EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PAYMENTS_NAME_ON_CARD_REQUIRED), + instrument.GetMissingInfoLabel()); } // A local card with no name is not a valid instrument for payment. TEST_F(AutofillPaymentInstrumentTest, IsCompleteForPayment_NoNumber) { autofill::CreditCard& card = local_credit_card(); card.SetNumber(base::ASCIIToUTF16("")); + base::string16 missing_info; AutofillPaymentInstrument instrument("visa", card, billing_profiles(), "en-US", nullptr); EXPECT_FALSE(instrument.IsCompleteForPayment()); + EXPECT_EQ(l10n_util::GetStringUTF16( + IDS_PAYMENTS_CARD_NUMBER_INVALID_VALIDATION_MESSAGE), + instrument.GetMissingInfoLabel()); +} + +// A local card with no name and no number is not a valid instrument for +// payment. +TEST_F(AutofillPaymentInstrumentTest, + IsCompleteForPayment_MultipleThingsMissing) { + autofill::CreditCard& card = local_credit_card(); + card.SetNumber(base::ASCIIToUTF16("")); + card.SetInfo(autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL), + base::ASCIIToUTF16(""), "en-US"); + AutofillPaymentInstrument instrument("visa", card, billing_profiles(), + "en-US", nullptr); + EXPECT_FALSE(instrument.IsCompleteForPayment()); + EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PAYMENTS_MORE_INFORMATION_REQUIRED), + instrument.GetMissingInfoLabel()); } // A Masked (server) card is a valid instrument for payment. @@ -76,6 +105,7 @@ AutofillPaymentInstrument instrument("visa", card, billing_profiles(), "en-US", nullptr); EXPECT_TRUE(instrument.IsCompleteForPayment()); + EXPECT_TRUE(instrument.GetMissingInfoLabel().empty()); } // An expired masked (server) card is not a valid instrument for payment. @@ -85,6 +115,9 @@ AutofillPaymentInstrument instrument("visa", card, billing_profiles(), "en-US", nullptr); EXPECT_FALSE(instrument.IsCompleteForPayment()); + EXPECT_EQ(l10n_util::GetStringUTF16( + IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED), + instrument.GetMissingInfoLabel()); } // An expired card is a valid instrument for canMakePayment.
diff --git a/components/payments/core/payment_instrument.h b/components/payments/core/payment_instrument.h index 5d70847..608235be 100644 --- a/components/payments/core/payment_instrument.h +++ b/components/payments/core/payment_instrument.h
@@ -39,6 +39,9 @@ // Returns whether the instrument is complete to be used as a payment method // without further editing. virtual bool IsCompleteForPayment() = 0; + // Returns a message to indicate to the user what's missing for the instrument + // to be complete for payment. + virtual base::string16 GetMissingInfoLabel() = 0; // Returns whether the instrument is valid for the purposes of responding to // canMakePayment. virtual bool IsValidForCanMakePayment() = 0;
diff --git a/components/prefs/pref_service.cc b/components/prefs/pref_service.cc index 6858839..4ebea53 100644 --- a/components/prefs/pref_service.cc +++ b/components/prefs/pref_service.cc
@@ -193,37 +193,27 @@ return pref && !pref->IsDefaultValue(); } -std::unique_ptr<base::DictionaryValue> PrefService::GetPreferenceValues() - const { +void PrefService::IteratePreferenceValues( + base::RepeatingCallback<void(const std::string& key, + const base::Value& value)> callback) const { DCHECK(CalledOnValidThread()); - std::unique_ptr<base::DictionaryValue> out(new base::DictionaryValue); - for (const auto& it : *pref_registry_) { - out->Set(it.first, GetPreferenceValue(it.first)->CreateDeepCopy()); - } - return out; + for (const auto& it : *pref_registry_) + callback.Run(it.first, *GetPreferenceValue(it.first)); } -std::unique_ptr<base::DictionaryValue> -PrefService::GetPreferenceValuesOmitDefaults() const { +std::unique_ptr<base::DictionaryValue> PrefService::GetPreferenceValues( + IncludeDefaults include_defaults) const { DCHECK(CalledOnValidThread()); std::unique_ptr<base::DictionaryValue> out(new base::DictionaryValue); for (const auto& it : *pref_registry_) { - const Preference* pref = FindPreference(it.first); - if (pref->IsDefaultValue()) - continue; - out->Set(it.first, pref->GetValue()->CreateDeepCopy()); - } - return out; -} - -std::unique_ptr<base::DictionaryValue> -PrefService::GetPreferenceValuesWithoutPathExpansion() const { - DCHECK(CalledOnValidThread()); - std::unique_ptr<base::DictionaryValue> out(new base::DictionaryValue); - for (const auto& it : *pref_registry_) { - const base::Value* value = GetPreferenceValue(it.first); - DCHECK(value); - out->SetWithoutPathExpansion(it.first, value->CreateDeepCopy()); + if (include_defaults == INCLUDE_DEFAULTS) { + out->Set(it.first, GetPreferenceValue(it.first)->CreateDeepCopy()); + } else { + const Preference* pref = FindPreference(it.first); + if (pref->IsDefaultValue()) + continue; + out->Set(it.first, pref->GetValue()->CreateDeepCopy()); + } } return out; }
diff --git a/components/prefs/pref_service.h b/components/prefs/pref_service.h index e08e361..a08d7f85 100644 --- a/components/prefs/pref_service.h +++ b/components/prefs/pref_service.h
@@ -60,6 +60,11 @@ INITIALIZATION_STATUS_ERROR }; + enum IncludeDefaults { + INCLUDE_DEFAULTS, + EXCLUDE_DEFAULTS, + }; + // A helper class to store all the information associated with a preference. class COMPONENTS_PREFS_EXPORT Preference { public: @@ -250,23 +255,22 @@ // this checks if a value exists for the path. bool HasPrefPath(const std::string& path) const; - // Returns a dictionary with effective preference values. - std::unique_ptr<base::DictionaryValue> GetPreferenceValues() const; + // Issues a callback for every preference value. The preferences must not be + // mutated during iteration. + void IteratePreferenceValues( + base::RepeatingCallback<void(const std::string& key, + const base::Value& value)> callback) const; - // Returns a dictionary with effective preference values, omitting prefs that - // are at their default values. - std::unique_ptr<base::DictionaryValue> GetPreferenceValuesOmitDefaults() - const; - - // Returns a dictionary with effective preference values. Contrary to - // GetPreferenceValues(), the paths of registered preferences are not split on - // '.' characters. If a registered preference stores a dictionary, however, - // the hierarchical structure inside the preference will be preserved. - // For example, if "foo.bar" is a registered preference, the result could look - // like this: - // {"foo.bar": {"a": {"b": true}}}. - std::unique_ptr<base::DictionaryValue> - GetPreferenceValuesWithoutPathExpansion() const; + // Returns a dictionary with effective preference values. This is an expensive + // operation which does a deep copy. Use only if you really need the results + // in a base::Value (for example, for JSON serialization). Otherwise use + // IteratePreferenceValues above to avoid the copies. + // + // If INCLUDE_DEFAULTS is requested, preferences set to their default values + // will be included. Otherwise, these will be omitted from the returned + // dictionary. + std::unique_ptr<base::DictionaryValue> GetPreferenceValues( + IncludeDefaults include_defaults) const; bool ReadOnly() const;
diff --git a/components/security_state/content/content_utils.cc b/components/security_state/content/content_utils.cc index 0464d59..3b1b413 100644 --- a/components/security_state/content/content_utils.cc +++ b/components/security_state/content/content_utils.cc
@@ -154,10 +154,6 @@ state->key_exchange_group = ssl.key_exchange_group; state->security_bits = ssl.security_bits; state->pkp_bypassed = ssl.pkp_bypassed; - state->sct_verify_statuses.clear(); - state->sct_verify_statuses.insert(state->sct_verify_statuses.begin(), - ssl.sct_statuses.begin(), - ssl.sct_statuses.end()); state->displayed_mixed_content = !!(ssl.content_status & content::SSLStatus::DISPLAYED_INSECURE_CONTENT); state->ran_mixed_content =
diff --git a/components/security_state/core/security_state.cc b/components/security_state/core/security_state.cc index 0843ff8..aed4e42 100644 --- a/components/security_state/core/security_state.cc +++ b/components/security_state/core/security_state.cc
@@ -213,8 +213,6 @@ security_info->obsolete_ssl_status = net::ObsoleteSSLStatus(security_info->connection_status); security_info->pkp_bypassed = visible_security_state.pkp_bypassed; - security_info->sct_verify_statuses = - visible_security_state.sct_verify_statuses; security_info->malicious_content_status = visible_security_state.malicious_content_status; @@ -304,7 +302,6 @@ connection_status == other.connection_status && key_exchange_group == other.key_exchange_group && security_bits == other.security_bits && - sct_verify_statuses == other.sct_verify_statuses && displayed_mixed_content == other.displayed_mixed_content && ran_mixed_content == other.ran_mixed_content && displayed_content_with_cert_errors ==
diff --git a/components/security_state/core/security_state.h b/components/security_state/core/security_state.h index aa5e8d48..4d1ec3f9 100644 --- a/components/security_state/core/security_state.h +++ b/components/security_state/core/security_state.h
@@ -110,9 +110,6 @@ // content that was loaded over an HTTPS connection with // certificate errors. ContentStatus content_with_cert_errors_status; - // The verification statuses of the signed certificate timestamps - // for the connection. - std::vector<net::ct::SCTVerifyStatus> sct_verify_statuses; bool scheme_is_cryptographic; net::CertStatus cert_status; scoped_refptr<net::X509Certificate> certificate; @@ -168,9 +165,6 @@ // unknown (older cache entries may not store the value) or not applicable. uint16_t key_exchange_group; int security_bits; - // The verification statuses of the Signed Certificate - // Timestamps (if any) that the server provided. - std::vector<net::ct::SCTVerifyStatus> sct_verify_statuses; // True if the page displayed passive mixed content. bool displayed_mixed_content; // True if the secure page contained a form with a nonsecure target.
diff --git a/components/spellcheck/renderer/BUILD.gn b/components/spellcheck/renderer/BUILD.gn index eb323b2..2af3945f 100644 --- a/components/spellcheck/renderer/BUILD.gn +++ b/components/spellcheck/renderer/BUILD.gn
@@ -8,16 +8,10 @@ sources = [ "custom_dictionary_engine.cc", "custom_dictionary_engine.h", - "hunspell_engine.cc", - "hunspell_engine.h", - "platform_spelling_engine.cc", - "platform_spelling_engine.h", "spellcheck.cc", "spellcheck.h", "spellcheck_language.cc", "spellcheck_language.h", - "spellcheck_panel.cc", - "spellcheck_panel.h", "spellcheck_provider.cc", "spellcheck_provider.h", "spellcheck_worditerator.cc", @@ -25,22 +19,22 @@ "spelling_engine.h", ] - if (!use_browser_spellchecker) { - sources -= [ + if (use_browser_spellchecker) { + sources += [ "platform_spelling_engine.cc", "platform_spelling_engine.h", ] } - if (!has_spellcheck_panel) { - sources -= [ + if (has_spellcheck_panel) { + sources += [ "spellcheck_panel.cc", "spellcheck_panel.h", ] } - if (is_android) { - sources -= [ + if (!is_android) { + sources += [ "hunspell_engine.cc", "hunspell_engine.h", ] @@ -71,35 +65,28 @@ testonly = true sources = [ "custom_dictionary_engine_unittest.cc", - "spellcheck_multilingual_unittest.cc", - "spellcheck_provider_hunspell_unittest.cc", "spellcheck_provider_mac_unittest.cc", "spellcheck_provider_test.cc", "spellcheck_provider_test.h", "spellcheck_provider_unittest.cc", - "spellcheck_unittest.cc", "spellcheck_worditerator_unittest.cc", ] data = [ "//third_party/hunspell_dictionaries/", ] - if (is_mac) { - sources -= [ + if (!is_android) { + sources += [ "spellcheck_unittest.cc" ] + } + + if (!is_mac && !is_android) { + sources += [ # This tests Chrome's spellchecker which Mac doesn't use. "spellcheck_multilingual_unittest.cc", "spellcheck_provider_hunspell_unittest.cc", ] } - if (is_android) { - sources -= [ - "spellcheck_multilingual_unittest.cc", - "spellcheck_provider_hunspell_unittest.cc", - "spellcheck_unittest.cc", - ] - } - deps = [ ":renderer", "//base:i18n",
diff --git a/content/browser/background_fetch/background_fetch_job_controller.cc b/content/browser/background_fetch/background_fetch_job_controller.cc index e4dd6471..3d4297c 100644 --- a/content/browser/background_fetch/background_fetch_job_controller.cc +++ b/content/browser/background_fetch/background_fetch_job_controller.cc
@@ -18,8 +18,24 @@ #include "content/public/browser/download_manager.h" #include "net/url_request/url_request_context_getter.h" +#if defined(OS_ANDROID) +#include "base/android/path_utils.h" +#include "base/files/file_path.h" +#include "base/guid.h" +#endif + namespace content { +#if defined(OS_ANDROID) +namespace { + +// Prefix for files stored in the Chromium-internal download directory to +// indicate files thta were fetched through Background Fetch. +const char kBackgroundFetchFilePrefix[] = "BGFetch-"; + +} // namespace +#endif // defined(OS_ANDROID) + // Internal functionality of the BackgroundFetchJobController that lives on the // UI thread, where all interaction with the download manager must happen. class BackgroundFetchJobController::Core : public DownloadItem::Observer { @@ -59,7 +75,20 @@ // TODO(peter): The |download_parameters| should be populated with all the // properties set in the |fetch_request| structure. + // TODO(peter): Background Fetch responses should not end up in the user's + // download folder on any platform. Find an appropriate solution for desktop + // too. The Android internal directory is not scoped to a profile. + download_parameters->set_transient(true); + +#if defined(OS_ANDROID) + base::FilePath download_directory; + if (base::android::GetDownloadInternalDirectory(&download_directory)) { + download_parameters->set_file_path(download_directory.Append( + std::string(kBackgroundFetchFilePrefix) + base::GenerateGUID())); + } +#endif // defined(OS_ANDROID) + download_parameters->set_callback(base::Bind(&Core::DidStartRequest, weak_ptr_factory_.GetWeakPtr(), std::move(request)));
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index 9969de5..61dfb2b 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc
@@ -802,8 +802,6 @@ // API either. if (!CanCommitURL(child_id, filesystem_url.origin())) { UMA_HISTOGRAM_BOOLEAN("FileSystem.OriginFailedCanCommitURL", true); - // TODO(nick): Temporary instrumentation for https://crbug.com/654479. - base::debug::DumpWithoutCrashing(); return false; }
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc index 3a5f2b4..bfd807a 100644 --- a/content/browser/loader/navigation_url_loader_network_service.cc +++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -46,9 +46,6 @@ new_request->first_party_for_cookies = request_info->first_party_for_cookies; new_request->priority = net::HIGHEST; - mojom::URLLoaderClientPtr url_loader_client_ptr; - mojom::URLLoaderClientRequest url_loader_client_request = - mojo::MakeRequest(&url_loader_client_ptr); mojom::URLLoaderClientPtr url_loader_client_ptr_to_pass; binding_.Bind(&url_loader_client_ptr_to_pass);
diff --git a/content/browser/renderer_host/input/passthrough_touch_event_queue.cc b/content/browser/renderer_host/input/passthrough_touch_event_queue.cc index a13ccbf5..ae2131f 100644 --- a/content/browser/renderer_host/input/passthrough_touch_event_queue.cc +++ b/content/browser/renderer_host/input/passthrough_touch_event_queue.cc
@@ -24,10 +24,6 @@ namespace content { namespace { -// A sanity check on touches received to ensure that touch movement outside -// the platform slop region will cause scrolling. -const double kMaxConceivablePlatformSlopRegionLengthDipsSquared = 60. * 60.; - // Compare all properties of touch points to determine the state. bool HasPointChanged(const WebTouchPoint& point_1, const WebTouchPoint& point_2) { @@ -46,59 +42,6 @@ } // namespace -// Provides touchmove slop suppression for a touch sequence until a -// (unprevented) touch will trigger immediate scrolling. -class TouchMoveSlopSuppressor { - public: - TouchMoveSlopSuppressor() : suppressing_touchmoves_(false) {} - - bool FilterEvent(const WebTouchEvent& event) { - if (WebTouchEventTraits::IsTouchSequenceStart(event)) { - suppressing_touchmoves_ = true; - touch_start_location_ = gfx::PointF(event.touches[0].position); - } - - if (event.GetType() == WebInputEvent::kTouchEnd || - event.GetType() == WebInputEvent::kTouchCancel) - suppressing_touchmoves_ = false; - - if (event.GetType() != WebInputEvent::kTouchMove) - return false; - - if (suppressing_touchmoves_) { - if (event.touches_length > 1) { - suppressing_touchmoves_ = false; - } else if (event.moved_beyond_slop_region) { - suppressing_touchmoves_ = false; - } else { - // No sane slop region should be larger than 60 DIPs. - DCHECK_LT( - (gfx::PointF(event.touches[0].position) - touch_start_location_) - .LengthSquared(), - kMaxConceivablePlatformSlopRegionLengthDipsSquared); - } - } - - return suppressing_touchmoves_; - } - - void ConfirmTouchEvent(InputEventAckState ack_result) { - if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) - suppressing_touchmoves_ = false; - } - - bool suppressing_touchmoves() const { return suppressing_touchmoves_; } - - private: - bool suppressing_touchmoves_; - - // Sanity check that the upstream touch provider is properly reporting whether - // the touch sequence will cause scrolling. - gfx::PointF touch_start_location_; - - DISALLOW_COPY_AND_ASSIGN(TouchMoveSlopSuppressor); -}; - PassthroughTouchEventQueue::TouchEventWithLatencyInfoAndAckState:: TouchEventWithLatencyInfoAndAckState(const TouchEventWithLatencyInfo& event) : TouchEventWithLatencyInfo(event), @@ -116,8 +59,8 @@ has_handlers_(true), maybe_has_handler_for_current_sequence_(false), drop_remaining_touches_in_sequence_(false), - touchmove_slop_suppressor_(new TouchMoveSlopSuppressor), - send_touch_events_async_(false) { + send_touch_events_async_(false), + processing_acks_(false) { if (config.touch_ack_timeout_supported) { timeout_handler_.reset( new TouchTimeoutHandler(this, config.desktop_touch_ack_timeout_delay, @@ -178,8 +121,6 @@ timeout_handler_->ConfirmTouchEvent(unique_touch_event_id, ack_result)) return; - touchmove_slop_suppressor_->ConfirmTouchEvent(ack_result); - auto touch_event_iter = outstanding_touches_.begin(); while (touch_event_iter != outstanding_touches_.end()) { if (unique_touch_event_id == touch_event_iter->event.unique_touch_event_id) @@ -265,6 +206,11 @@ } void PassthroughTouchEventQueue::AckCompletedEvents() { + // Don't allow re-entrancy into this method otherwise + // the ordering of acks won't be preserved. + if (processing_acks_) + return; + base::AutoReset<bool> process_acks(&processing_acks_, true); while (!outstanding_touches_.empty()) { auto iter = outstanding_touches_.begin(); if (iter->ack_state() == INPUT_EVENT_ACK_STATE_UNKNOWN) @@ -357,9 +303,6 @@ if (timeout_handler_ && timeout_handler_->FilterEvent(event)) return ACK_WITH_NO_CONSUMER_EXISTS; - if (touchmove_slop_suppressor_->FilterEvent(event)) - return ACK_WITH_NOT_CONSUMED; - if (drop_remaining_touches_in_sequence_ && event.GetType() != WebInputEvent::kTouchCancel) { return ACK_WITH_NO_CONSUMER_EXISTS;
diff --git a/content/browser/renderer_host/input/passthrough_touch_event_queue.h b/content/browser/renderer_host/input/passthrough_touch_event_queue.h index 561d0c20..cae55abf 100644 --- a/content/browser/renderer_host/input/passthrough_touch_event_queue.h +++ b/content/browser/renderer_host/input/passthrough_touch_event_queue.h
@@ -12,7 +12,6 @@ namespace content { class TouchTimeoutHandler; -class TouchMoveSlopSuppressor; // A queue that processes a touch-event and forwards it on to the // renderer process immediately. This class assumes that queueing will @@ -116,16 +115,14 @@ // cancelled after a touch timeout. bool drop_remaining_touches_in_sequence_; - // Suppresses TouchMove's within a slop region when a sequence has not yet - // been preventDefaulted. - std::unique_ptr<TouchMoveSlopSuppressor> touchmove_slop_suppressor_; - // Optional handler for timed-out touch event acks. std::unique_ptr<TouchTimeoutHandler> timeout_handler_; // Whether touch events should be sent as uncancelable or not. bool send_touch_events_async_; + bool processing_acks_; + // Event is saved to compare pointer positions for new touchmove events. std::unique_ptr<blink::WebTouchEvent> last_sent_touchevent_;
diff --git a/content/browser/renderer_host/input/passthrough_touch_event_queue_unittest.cc b/content/browser/renderer_host/input/passthrough_touch_event_queue_unittest.cc index 833f0ab5..2bed8a6df 100644 --- a/content/browser/renderer_host/input/passthrough_touch_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/passthrough_touch_event_queue_unittest.cc
@@ -64,15 +64,14 @@ sent_events_ids_.push_back(event.event.unique_touch_event_id); if (sync_ack_result_) { auto sync_ack_result = std::move(sync_ack_result_); - SendTouchEventAck(*sync_ack_result); + SendTouchEventAckWithID(*sync_ack_result, + event.event.unique_touch_event_id); } } void OnTouchEventAck(const TouchEventWithLatencyInfo& event, InputEventAckState ack_result) override { ++acked_event_count_; - last_acked_event_ = event.event; - last_acked_event_state_ = ack_result; if (followup_touch_event_) { std::unique_ptr<WebTouchEvent> followup_touch_event = std::move(followup_touch_event_); @@ -84,6 +83,8 @@ queue_->OnGestureScrollEvent(GestureEventWithLatencyInfo( *followup_gesture_event, ui::LatencyInfo())); } + last_acked_event_ = event.event; + last_acked_event_state_ = ack_result; } void OnFilteringTouchEvent(const blink::WebTouchEvent& touch_event) override { @@ -756,6 +757,46 @@ EXPECT_EQ(1U, GetAndResetAckedEventCount()); } +// Tests that touch-events acks are in order even with synchronous acks. +TEST_F(PassthroughTouchEventQueueTest, SynchronousAcksInOrder) { + // TouchStart + PressTouchPoint(1, 1); + EXPECT_EQ(1U, queued_event_count()); + EXPECT_EQ(1U, GetAndResetSentEventCount()); + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + + // TouchMove + MoveTouchPoint(0, 2, 3); + EXPECT_EQ(2U, queued_event_count()); + EXPECT_EQ(1U, GetAndResetSentEventCount()); + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + + // Ack the TouchMove + SendTouchEventAckLast(INPUT_EVENT_ACK_STATE_CONSUMED); + EXPECT_EQ(2U, queued_event_count()); + EXPECT_EQ(0U, GetAndResetSentEventCount()); + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + + // Create a touch event that will be queued synchronously by a touch ack. + WebTouchEvent followup_event( + WebInputEvent::kTouchMove, WebInputEvent::kNoModifiers, + ui::EventTimeStampToSeconds(ui::EventTimeForNow())); + followup_event.touches_length = 1; + followup_event.touches[0].id = 0; + followup_event.unique_touch_event_id = 100; + followup_event.touches[0].state = WebTouchPoint::kStateMoved; + SetFollowupEvent(followup_event); + SetSyncAckResult(INPUT_EVENT_ACK_STATE_CONSUMED); + + // Ack the touch start, should release the |follow_up| event (and its ack). + SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); + + EXPECT_EQ(0U, queued_event_count()); + EXPECT_EQ(1U, GetAndResetSentEventCount()); + EXPECT_EQ(3U, GetAndResetAckedEventCount()); + EXPECT_EQ(100U, acked_event().unique_touch_event_id); +} + // Tests that followup events triggered by an immediate ack from // TouchEventQueue::QueueEvent() are properly handled. TEST_F(PassthroughTouchEventQueueTest, ImmediateAckWithFollowupEvents) { @@ -774,7 +815,6 @@ WebTouchEvent stationary_event( WebInputEvent::kTouchMove, WebInputEvent::kNoModifiers, ui::EventTimeStampToSeconds(ui::EventTimeForNow())); - ; stationary_event.touches_length = 1; stationary_event.touches[0].id = 1; stationary_event.touches[0].state = WebTouchPoint::kStateStationary; @@ -1250,32 +1290,37 @@ // TouchMove's movedBeyondSlopRegion within the slop region is set to false. MoveTouchPoint(0, 0, kHalfSlopLengthDips); - EXPECT_EQ(0U, queued_event_count()); - EXPECT_EQ(0U, GetAndResetSentEventCount()); + EXPECT_EQ(1U, queued_event_count()); + SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + EXPECT_EQ(1U, GetAndResetSentEventCount()); EXPECT_EQ(1U, GetAndResetAckedEventCount()); EXPECT_FALSE(acked_event().moved_beyond_slop_region); MoveTouchPoint(0, kHalfSlopLengthDips, 0); - EXPECT_EQ(0U, queued_event_count()); - EXPECT_EQ(0U, GetAndResetSentEventCount()); + EXPECT_EQ(1U, queued_event_count()); + SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + EXPECT_EQ(1U, GetAndResetSentEventCount()); EXPECT_EQ(1U, GetAndResetAckedEventCount()); EXPECT_FALSE(acked_event().moved_beyond_slop_region); MoveTouchPoint(0, -kHalfSlopLengthDips, 0); - EXPECT_EQ(0U, queued_event_count()); - EXPECT_EQ(0U, GetAndResetSentEventCount()); + EXPECT_EQ(1U, queued_event_count()); + SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + EXPECT_EQ(1U, GetAndResetSentEventCount()); EXPECT_EQ(1U, GetAndResetAckedEventCount()); EXPECT_FALSE(acked_event().moved_beyond_slop_region); MoveTouchPoint(0, -kSlopLengthDips, 0); - EXPECT_EQ(0U, queued_event_count()); - EXPECT_EQ(0U, GetAndResetSentEventCount()); + EXPECT_EQ(1U, queued_event_count()); + SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + EXPECT_EQ(1U, GetAndResetSentEventCount()); EXPECT_EQ(1U, GetAndResetAckedEventCount()); EXPECT_FALSE(acked_event().moved_beyond_slop_region); MoveTouchPoint(0, 0, kSlopLengthDips); - EXPECT_EQ(0U, queued_event_count()); - EXPECT_EQ(0U, GetAndResetSentEventCount()); + EXPECT_EQ(1U, queued_event_count()); + SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + EXPECT_EQ(1U, GetAndResetSentEventCount()); EXPECT_EQ(1U, GetAndResetAckedEventCount()); EXPECT_FALSE(acked_event().moved_beyond_slop_region); @@ -1290,6 +1335,7 @@ EXPECT_EQ(0U, GetAndResetAckedEventCount()); SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); EXPECT_EQ(1U, GetAndResetAckedEventCount()); + EXPECT_TRUE(acked_event().moved_beyond_slop_region); } // Tests that even very small TouchMove's movedBeyondSlopRegion is set to true
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index 2924fb2..ce0f2d4 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -1692,7 +1692,7 @@ EXPECT_TRUE(press.synchronous_handling_disabled()); EXPECT_EQ(ui::MotionEvent::ACTION_DOWN, pointer_state().GetAction()); EXPECT_EQ(1U, pointer_state().GetPointerCount()); - EXPECT_EQ(2U, GetSentMessageCountAndResetSink()); + EXPECT_EQ(3U, GetSentMessageCountAndResetSink()); widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false));
diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index fb74aa1d..25a2ba5a 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc
@@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/location.h" #include "base/macros.h" +#include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" @@ -21,6 +22,7 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h" +#include "content/common/frame_messages.h" #include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" @@ -30,10 +32,12 @@ #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" +#include "content/public/test/test_utils.h" #include "content/shell/browser/shell.h" #include "media/base/video_frame.h" #include "media/renderers/skcanvas_video_renderer.h" #include "net/base/filename_util.h" +#include "net/dns/mock_host_resolver.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkCanvas.h" #include "ui/base/layout.h" @@ -202,6 +206,73 @@ int frames_captured_; }; +// Helps to ensure that a navigation is committed after a compositor frame was +// submitted by the renderer, but before corresponding ACK is sent back. +class CommitBeforeSwapAckSentHelper : public WebContentsObserver { + public: + explicit CommitBeforeSwapAckSentHelper(WebContents* web_contents) + : WebContentsObserver(web_contents) {} + + private: + void WaitForSwapCompositorFrame() { + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); + FrameWatcher(web_contents()).WaitFrames(1); + } + + bool OnMessageReceived(const IPC::Message& message, + RenderFrameHost* rfh) override { + IPC_BEGIN_MESSAGE_MAP(CommitBeforeSwapAckSentHelper, message) + IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, + WaitForSwapCompositorFrame()) + IPC_END_MESSAGE_MAP() + return false; + } + + DISALLOW_COPY_AND_ASSIGN(CommitBeforeSwapAckSentHelper); +}; + +using RenderWidgetHostViewBrowserTestBase = ContentBrowserTest; + +IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewBrowserTestBase, + CompositorWorksWhenReusingRenderer) { + host_resolver()->AddRule("*", "127.0.0.1"); + ASSERT_TRUE(embedded_test_server()->Start()); + auto* web_contents = shell()->web_contents(); + // Load a page that draws new frames infinitely. + NavigateToURL(shell(), + embedded_test_server()->GetURL("/page_with_animation.html")); + + // Open a new page in the same renderer to keep it alive. + WebContents::CreateParams new_contents_params( + web_contents->GetBrowserContext(), web_contents->GetSiteInstance()); + std::unique_ptr<WebContents> new_web_contents( + WebContents::Create(new_contents_params)); + + new_web_contents->GetController().LoadURLWithParams( + NavigationController::LoadURLParams(GURL(url::kAboutBlankURL))); + EXPECT_TRUE(WaitForLoadStop(new_web_contents.get())); + + // Start a cross-process navigation. + shell()->LoadURL(embedded_test_server()->GetURL("foo.com", "/title1.html")); + + // When the navigation is about to commit, wait for the next frame to be + // submitted by the renderer before proceeding with page load. + { + CommitBeforeSwapAckSentHelper commit_helper(web_contents); + EXPECT_TRUE(WaitForLoadStop(web_contents)); + EXPECT_NE(web_contents->GetRenderProcessHost(), + new_web_contents->GetRenderProcessHost()); + } + + // Go back and verify that the renderer continues to draw new frames. + shell()->GoBackOrForward(-1); + EXPECT_TRUE(WaitForLoadStop(web_contents)); + EXPECT_EQ(web_contents->GetRenderProcessHost(), + new_web_contents->GetRenderProcessHost()); + FrameWatcher(web_contents).WaitFrames(5); +} + enum CompositingMode { GL_COMPOSITING, SOFTWARE_COMPOSITING,
diff --git a/content/common/cursors/webcursor_ozone.cc b/content/common/cursors/webcursor_ozone.cc index 6095da9f..b28ab00 100644 --- a/content/common/cursors/webcursor_ozone.cc +++ b/content/common/cursors/webcursor_ozone.cc
@@ -35,8 +35,8 @@ ui::ScaleAndRotateCursorBitmapAndHotpoint(scale, rotation_, &bitmap, &hotspot); - platform_cursor_ = - ui::CursorFactoryOzone::GetInstance()->CreateImageCursor(bitmap, hotspot); + platform_cursor_ = ui::CursorFactoryOzone::GetInstance()->CreateImageCursor( + bitmap, hotspot, scale); return platform_cursor_; }
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn index 35100354..434d3f1 100644 --- a/content/public/android/BUILD.gn +++ b/content/public/android/BUILD.gn
@@ -441,6 +441,7 @@ "javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java", "javatests/src/org/chromium/content/browser/input/ImeLollipopTest.java", "javatests/src/org/chromium/content/browser/input/ImeTest.java", + "javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java", "javatests/src/org/chromium/content/browser/input/ImeTestUtils.java", "javatests/src/org/chromium/content/browser/input/InputDialogContainerTest.java", "javatests/src/org/chromium/content/browser/input/SelectPopupTest.java",
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildConnectionAllocator.java b/content/public/android/java/src/org/chromium/content/browser/ChildConnectionAllocator.java index 56230dda..43c0367 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ChildConnectionAllocator.java +++ b/content/public/android/java/src/org/chromium/content/browser/ChildConnectionAllocator.java
@@ -145,7 +145,7 @@ -1); } } catch (PackageManager.NameNotFoundException e) { - throw new RuntimeException("Could not get application info"); + throw new RuntimeException("Could not get application info", e); } } if (numServices < 0) { @@ -155,7 +155,7 @@ } @VisibleForTesting - public static void setSanboxServicesSettingsForTesting(int serviceCount, String serviceName) { + public static void setSandboxServicesSettingsForTesting(int serviceCount, String serviceName) { sSandboxedServicesCountForTesting = serviceCount; sSandboxedServicesNameForTesting = serviceName; }
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java index 1336d3df..c6e5262 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java +++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
@@ -126,7 +126,7 @@ // Proactively releases all the moderate bindings once all the sandboxed services // are allocated, which will be very likely to have some of them killed by OOM // killer. - sBindingManager.releaseAllModerateBindings(); + getBindingManager().releaseAllModerateBindings(); } } return connection; @@ -182,6 +182,9 @@ private static Map<Integer, ChildProcessConnection> sServiceMap = new ConcurrentHashMap<Integer, ChildProcessConnection>(); + // Lock for getBindingManager() + private static final Object sBindingManagerLock = new Object(); + // These variables are used for the warm up sandboxed connection. // |sSpareSandboxedConnection| is non-null when there is a pending connection. Note it's cleared // to null again after the connection is used for a real child process. @@ -193,15 +196,21 @@ private static boolean sSpareConnectionStarting; private static ChildProcessConnection.StartCallback sSpareConnectionStartCallback; - // Manages oom bindings used to bind chind services. - private static BindingManager sBindingManager = BindingManagerImpl.createBindingManager(); + // Manages oom bindings used to bind chind services. Lazily initialized by getBindingManager() + private static BindingManager sBindingManager; // Whether the main application is currently brought to the foreground. private static boolean sApplicationInForeground = true; + // Lazy initialize sBindingManager // TODO(boliu): This should be internal to content. public static BindingManager getBindingManager() { - return sBindingManager; + synchronized (sBindingManagerLock) { + if (sBindingManager == null) { + sBindingManager = BindingManagerImpl.createBindingManager(); + } + return sBindingManager; + } } @VisibleForTesting @@ -214,7 +223,7 @@ * rely on renderer visibility signalled through setInForeground. See http://crbug.com/421041. */ public static void determinedVisibility(int pid) { - sBindingManager.determinedVisibility(pid); + getBindingManager().determinedVisibility(pid); } /** @@ -222,7 +231,7 @@ */ public static void onSentToBackground() { sApplicationInForeground = false; - sBindingManager.onSentToBackground(); + getBindingManager().onSentToBackground(); } /** @@ -236,7 +245,7 @@ * sent to the background. */ public static void startModerateBindingManagement(Context context) { - sBindingManager.startModerateBindingManagement(context, + getBindingManager().startModerateBindingManagement(context, ChildConnectionAllocator.getNumberOfServices( context, true, context.getPackageName())); } @@ -246,7 +255,7 @@ */ public static void onBroughtToForeground() { sApplicationInForeground = true; - sBindingManager.onBroughtToForeground(); + getBindingManager().onBroughtToForeground(); } /** @@ -466,7 +475,7 @@ public void onConnected(int pid) { Log.d(TAG, "on connect callback, pid=%d", pid); if (pid != NULL_PROCESS_HANDLE) { - sBindingManager.addNewConnection(pid, connection); + getBindingManager().addNewConnection(pid, connection); sServiceMap.put(pid, connection); } // If the connection fails and pid == 0, the Java-side cleanup was already @@ -495,7 +504,7 @@ // Can happen for single process. return; } - sBindingManager.clearConnection(pid); + getBindingManager().clearConnection(pid); connection.stop(); freeConnection(connection); }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java index ab17b60d..c4f1d473 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
@@ -14,8 +14,13 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; +import android.support.test.InstrumentationRegistry; import android.support.test.filters.MediumTest; -import android.test.InstrumentationTestCase; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; import org.chromium.base.BaseSwitches; import org.chromium.base.ThreadUtils; @@ -25,6 +30,7 @@ import org.chromium.base.process_launcher.FileDescriptorInfo; import org.chromium.base.test.util.Feature; import org.chromium.content.browser.test.ChildProcessAllocatorSettings; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.common.ContentSwitches; @@ -35,7 +41,8 @@ /** * Instrumentation tests for ChildProcessLauncher. */ -public class ChildProcessLauncherTest extends InstrumentationTestCase { +@RunWith(ContentJUnit4ClassRunner.class) +public class ChildProcessLauncherTest { // Pseudo command line arguments to instruct the child process to wait until being killed. // Allowing the process to continue would lead to a crash when attempting to initialize IPC // channels that are not being set up in this test. @@ -45,26 +52,26 @@ private static final String DEFAULT_SANDBOXED_PROCESS_SERVICE = "org.chromium.content.app.SandboxedProcessService"; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { LibraryLoader.get(LibraryProcessType.PROCESS_CHILD).ensureInitialized(); } /** * Tests cleanup for a connection that fails to connect in the first place. */ + @Test @MediumTest @Feature({"ProcessManagement"}) @ChildProcessAllocatorSettings(sandboxedServiceCount = 4) public void testServiceFailedToBind() { - assertEquals(0, allocatedChromeSandboxedConnectionsCount()); - assertEquals(0, ChildProcessLauncher.connectedServicesCountForTesting()); + Assert.assertEquals(0, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(0, ChildProcessLauncher.connectedServicesCountForTesting()); // Try to allocate a connection to service class in incorrect package. We can do that by // using the instrumentation context (getContext()) instead of the app context // (getTargetContext()). - Context context = getInstrumentation().getContext(); + Context context = InstrumentationRegistry.getInstrumentation().getContext(); allocateBoundConnectionForTesting( context, getDefaultChildProcessCreationParams(context.getPackageName())); @@ -87,19 +94,20 @@ /** * Tests cleanup for a connection that terminates before setup. */ + @Test @MediumTest @Feature({"ProcessManagement"}) public void testServiceCrashedBeforeSetup() throws RemoteException { - assertEquals(0, allocatedChromeSandboxedConnectionsCount()); - assertEquals(0, ChildProcessLauncher.connectedServicesCountForTesting()); + Assert.assertEquals(0, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(0, ChildProcessLauncher.connectedServicesCountForTesting()); // Start and connect to a new service. final ChildProcessConnectionImpl connection = startConnection(); - assertEquals(1, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(1, allocatedChromeSandboxedConnectionsCount()); // Verify that the service is not yet set up. - assertEquals(0, connection.getPid()); - assertEquals(0, ChildProcessLauncher.connectedServicesCountForTesting()); + Assert.assertEquals(0, connection.getPid()); + Assert.assertEquals(0, ChildProcessLauncher.connectedServicesCountForTesting()); // Crash the service. connection.crashServiceForTesting(); @@ -123,14 +131,15 @@ /** * Tests cleanup for a connection that terminates after setup. */ + @Test @MediumTest @Feature({"ProcessManagement"}) public void testServiceCrashedAfterSetup() throws RemoteException { - assertEquals(0, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(0, allocatedChromeSandboxedConnectionsCount()); // Start and connect to a new service. final ChildProcessConnectionImpl connection = startConnection(); - assertEquals(1, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(1, allocatedChromeSandboxedConnectionsCount()); // Initiate the connection setup. triggerConnectionSetup(connection); @@ -170,21 +179,22 @@ })); // Verify that the connection pid remains set after termination. - assertTrue(connection.getPid() != 0); + Assert.assertTrue(connection.getPid() != 0); } /** * Tests spawning a pending process from queue. */ + @Test @MediumTest @Feature({"ProcessManagement"}) public void testPendingSpawnQueue() throws RemoteException { - final Context appContext = getInstrumentation().getTargetContext(); - assertEquals(0, allocatedChromeSandboxedConnectionsCount()); + final Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + Assert.assertEquals(0, allocatedChromeSandboxedConnectionsCount()); // Start and connect to a new service. final ChildProcessConnectionImpl connection = startConnection(); - assertEquals(1, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(1, allocatedChromeSandboxedConnectionsCount()); // Queue up a new spawn request. There is no way to kill the pending connection, leak it // until the browser restart. @@ -192,7 +202,7 @@ final boolean inSandbox = true; enqueuePendingSpawnForTesting(appContext, sProcessWaitArguments, getDefaultChildProcessCreationParams(packageName), inSandbox); - assertEquals(1, pendingSpawnsCountForTesting(appContext, packageName, inSandbox)); + Assert.assertEquals(1, pendingSpawnsCountForTesting(appContext, packageName, inSandbox)); // Initiate the connection setup. triggerConnectionSetup(connection); @@ -246,16 +256,17 @@ * Tests service number of connections for external APKs and regular tabs are assigned properly, * i.e. from different ChildConnectionAllocators. */ + @Test @MediumTest @Feature({"ProcessManagement"}) @ChildProcessAllocatorSettings( sandboxedServiceCount = 4, sandboxedServiceName = DEFAULT_SANDBOXED_PROCESS_SERVICE) public void testServiceNumberAllocation() { - Context appContext = getInstrumentation().getTargetContext(); - assertEquals(0, + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + Assert.assertEquals(0, allocatedSandboxedConnectionsCountForTesting( appContext, EXTERNAL_APK_PACKAGE_NAME)); - assertEquals(0, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(0, allocatedChromeSandboxedConnectionsCount()); // Start and connect to a new service of an external APK. ChildProcessConnectionImpl externalApkConnection = @@ -265,16 +276,16 @@ // Verify that one connection is allocated for an external APK and a regular tab // respectively. - assertEquals(1, + Assert.assertEquals(1, allocatedSandboxedConnectionsCountForTesting( appContext, EXTERNAL_APK_PACKAGE_NAME)); - assertEquals(1, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(1, allocatedChromeSandboxedConnectionsCount()); // Verify that connections allocated for an external APK and the regular tab are from // different ChildConnectionAllocators, since both ChildConnectionAllocators start // allocating connections from number 0. - assertEquals(0, externalApkConnection.getServiceNumber()); - assertEquals(0, tabConnection.getServiceNumber()); + Assert.assertEquals(0, externalApkConnection.getServiceNumber()); + Assert.assertEquals(0, tabConnection.getServiceNumber()); } /** @@ -282,29 +293,30 @@ * allocate a new connection to the APK, but we can still allocate a connection for a regular * tab. */ + @Test @MediumTest @Feature({"ProcessManagement"}) @ChildProcessAllocatorSettings( sandboxedServiceCount = 1, sandboxedServiceName = DEFAULT_SANDBOXED_PROCESS_SERVICE) public void testExceedMaximumConnectionNumber() { - Context appContext = getInstrumentation().getTargetContext(); - assertEquals(0, + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + Assert.assertEquals(0, allocatedSandboxedConnectionsCountForTesting( appContext, EXTERNAL_APK_PACKAGE_NAME)); // Setup a connection for an external APK to reach the maximum allowed connection number. ChildProcessConnectionImpl externalApkConnection = allocateConnection(EXTERNAL_APK_PACKAGE_NAME); - assertNotNull(externalApkConnection); + Assert.assertNotNull(externalApkConnection); // Verify that there isn't any connection available for the external APK. ChildProcessConnectionImpl exceedNumberExternalApkConnection = allocateConnection(EXTERNAL_APK_PACKAGE_NAME); - assertNull(exceedNumberExternalApkConnection); + Assert.assertNull(exceedNumberExternalApkConnection); // Verify that we can still allocate connection for a regular tab. ChildProcessConnectionImpl tabConnection = allocateConnection(appContext.getPackageName()); - assertNotNull(tabConnection); + Assert.assertNotNull(tabConnection); } /** @@ -314,10 +326,11 @@ * instrumentation test then tries to bind the same slot, which fails, so the * ChildProcessLauncher retries on a new connection. */ + @Test @MediumTest @Feature({"ProcessManagement"}) public void testBindServiceFromMultipleProcesses() throws RemoteException { - final Context context = getInstrumentation().getTargetContext(); + final Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); // Start the Helper service. class HelperConnection implements ServiceConnection { @@ -336,7 +349,7 @@ Intent intent = new Intent(); intent.setComponent(new ComponentName(context.getPackageName(), context.getPackageName() + ".ChildProcessLauncherTestHelperService")); - assertTrue(context.bindService(intent, serviceConn, Context.BIND_AUTO_CREATE)); + Assert.assertTrue(context.bindService(intent, serviceConn, Context.BIND_AUTO_CREATE)); // Wait for the Helper service to connect. CriteriaHelper.pollInstrumentationThread( @@ -347,7 +360,7 @@ } }); - assertNotNull(serviceConn.mMessenger); + Assert.assertNotNull(serviceConn.mMessenger); class ReplyHandler implements Handler.Callback { Message mMessage; @@ -378,13 +391,14 @@ }); // Verify that the Helper was able to launch the sandboxed service. - assertNotNull(replyHandler.mMessage); - assertEquals(ChildProcessLauncherTestHelperService.MSG_BIND_SERVICE_REPLY, + Assert.assertNotNull(replyHandler.mMessage); + Assert.assertEquals(ChildProcessLauncherTestHelperService.MSG_BIND_SERVICE_REPLY, replyHandler.mMessage.what); - assertEquals("Connection slot from helper service is not 0", 0, replyHandler.mMessage.arg2); + Assert.assertEquals( + "Connection slot from helper service is not 0", 0, replyHandler.mMessage.arg2); final int helperConnPid = replyHandler.mMessage.arg1; - assertTrue(helperConnPid > 0); + Assert.assertTrue(helperConnPid > 0); // Launch a service from this process. Since slot 0 is already bound by the Helper, it // will fail to start and the ChildProcessLauncher will retry. @@ -403,7 +417,7 @@ } }); - assertEquals(0, conn.getServiceNumber()); + Assert.assertEquals(0, conn.getServiceNumber()); final ChildProcessConnection[] sandboxedConnections = getSandboxedConnectionArrayForTesting(context, context.getPackageName()); @@ -426,23 +440,23 @@ for (int i = 0; i < sandboxedConnections.length; ++i) { ChildProcessConnection sandboxedConn = sandboxedConnections[i]; if (i <= 1) { - assertNotNull(sandboxedConn); - assertNotNull(sandboxedConn.getService()); + Assert.assertNotNull(sandboxedConn); + Assert.assertNotNull(sandboxedConn.getService()); } else { - assertNull(sandboxedConn); + Assert.assertNull(sandboxedConn); } } - assertTrue(conn == sandboxedConnections[0]); + Assert.assertTrue(conn == sandboxedConnections[0]); final ChildProcessConnection retryConn = sandboxedConnections[1]; - assertFalse(conn == retryConn); + Assert.assertFalse(conn == retryConn); - assertEquals(0, conn.getServiceNumber()); - assertEquals(0, conn.getPid()); - assertFalse(conn.getService().bindToCaller()); + Assert.assertEquals(0, conn.getServiceNumber()); + Assert.assertEquals(0, conn.getPid()); + Assert.assertFalse(conn.getService().bindToCaller()); - assertEquals(1, retryConn.getServiceNumber()); + Assert.assertEquals(1, retryConn.getServiceNumber()); CriteriaHelper.pollInstrumentationThread( new Criteria("Failed waiting retry connection to get pid") { @Override @@ -450,8 +464,8 @@ return retryConn.getPid() > 0; } }); - assertTrue(retryConn.getPid() != helperConnPid); - assertTrue(retryConn.getService().bindToCaller()); + Assert.assertTrue(retryConn.getPid() != helperConnPid); + Assert.assertTrue(retryConn.getService().bindToCaller()); } private static void warmUpOnUiThreadBlocking(final Context context) { @@ -463,20 +477,21 @@ }); } + @Test @MediumTest @Feature({"ProcessManagement"}) public void testWarmUp() { - final Context context = getInstrumentation().getTargetContext(); + final Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); warmUpOnUiThreadBlocking(context); ChildProcessLauncherTestHelperService.runOnLauncherThreadBlocking(new Runnable() { @Override public void run() { - assertEquals(1, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(1, allocatedChromeSandboxedConnectionsCount()); final ChildProcessConnection conn = ChildProcessLauncherTestHelperService.startInternalForTesting( context, new String[0], new FileDescriptorInfo[0], null); - assertEquals( + Assert.assertEquals( 1, allocatedChromeSandboxedConnectionsCount()); // Used warmup connection. ChildProcessLauncher.stop(conn.getPid()); @@ -484,11 +499,12 @@ }); } + @Test @MediumTest @Feature({"ProcessManagement"}) public void testCustomCreationParamDoesNotReuseWarmupConnection() { // Since warmUp only uses default params. - final Context context = getInstrumentation().getTargetContext(); + final Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); // Check uses object identity, having the params match exactly is fine. ChildProcessCreationParams.registerDefault( getDefaultChildProcessCreationParams(context.getPackageName())); @@ -499,14 +515,15 @@ ChildProcessLauncherTestHelperService.runOnLauncherThreadBlocking(new Runnable() { @Override public void run() { - assertEquals(1, allocatedChromeSandboxedConnectionsCount()); + Assert.assertEquals(1, allocatedChromeSandboxedConnectionsCount()); startRendererProcess(context, paramId, new FileDescriptorInfo[0]); - assertEquals(2, allocatedChromeSandboxedConnectionsCount()); // Warmup not used. + Assert.assertEquals( + 2, allocatedChromeSandboxedConnectionsCount()); // Warmup not used. startRendererProcess( context, ChildProcessCreationParams.DEFAULT_ID, new FileDescriptorInfo[0]); - assertEquals(2, allocatedChromeSandboxedConnectionsCount()); // Warmup used. + Assert.assertEquals(2, allocatedChromeSandboxedConnectionsCount()); // Warmup used. ChildProcessCreationParams.unregister(paramId); } @@ -515,7 +532,7 @@ private ChildProcessConnectionImpl startConnection() { // Allocate a new connection. - Context context = getInstrumentation().getTargetContext(); + Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); final ChildProcessConnectionImpl connection = (ChildProcessConnectionImpl) allocateBoundConnectionForTesting( context, getDefaultChildProcessCreationParams(context.getPackageName())); @@ -568,7 +585,7 @@ @Override public ChildProcessConnectionImpl call() { // Allocate a new connection. - Context context = getInstrumentation().getTargetContext(); + Context context = InstrumentationRegistry.getTargetContext(); ChildProcessCreationParams creationParams = getDefaultChildProcessCreationParams(packageName); return (ChildProcessConnectionImpl) ChildProcessLauncher.allocateConnection( @@ -644,7 +661,7 @@ * Returns the number of Chrome's sandboxed connections. */ private int allocatedChromeSandboxedConnectionsCount() { - Context context = getInstrumentation().getTargetContext(); + Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); return allocatedSandboxedConnectionsCountForTesting(context, context.getPackageName()); }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java index 1082bf5c..7c19b9d6 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java
@@ -11,23 +11,33 @@ import android.support.test.filters.SmallTest; import android.text.TextUtils; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.UrlUtils; import org.chromium.content.browser.input.ChromiumBaseInputConnection; import org.chromium.content.browser.input.ImeTestUtils; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.DOMUtils; -import org.chromium.content_shell_apk.ContentShellTestBase; +import org.chromium.content_shell_apk.ContentShellActivityTestRule; import java.util.concurrent.Callable; /** * Integration tests for text selection-related behavior. */ -public class ContentViewCoreSelectionTest extends ContentShellTestBase { +@RunWith(ContentJUnit4ClassRunner.class) +public class ContentViewCoreSelectionTest { + @Rule + public ContentShellActivityTestRule mActivityTestRule = new ContentShellActivityTestRule(); private static final String DATA_URL = UrlUtils.encodeHtmlDataUri( "<html><head><meta name=\"viewport\"" + "content=\"width=device-width, initial-scale=1.1, maximum-scale=1.5\" /></head>" @@ -44,19 +54,18 @@ private ContentViewCore mContentViewCore; private SelectionPopupController mSelectionPopupController; - @Override + @Before public void setUp() throws Exception { - super.setUp(); + mActivityTestRule.launchContentShellWithUrl(DATA_URL); + mActivityTestRule.waitForActiveShellToBeDoneLoading(); - launchContentShellWithUrl(DATA_URL); - waitForActiveShellToBeDoneLoading(); - - mContentViewCore = getContentViewCore(); + mContentViewCore = mActivityTestRule.getContentViewCore(); mSelectionPopupController = mContentViewCore.getSelectionPopupControllerForTesting(); waitForSelectActionBarVisible(false); waitForPastePopupStatus(false); } + @Test @SmallTest @Feature({"TextSelection"}) @DisabledTest(message = "crbug.com/592428") @@ -68,13 +77,14 @@ requestFocusOnUiThread(false); waitForSelectActionBarVisible(false); - assertFalse(mSelectionPopupController.hasSelection()); + Assert.assertFalse(mSelectionPopupController.hasSelection()); requestFocusOnUiThread(true); waitForSelectActionBarVisible(false); - assertFalse(mSelectionPopupController.hasSelection()); + Assert.assertFalse(mSelectionPopupController.hasSelection()); } + @Test @SmallTest @Feature({"TextSelection"}) @DisabledTest(message = "crbug.com/592428") @@ -83,61 +93,64 @@ DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); mContentViewCore.preserveSelectionOnNextLossOfFocus(); requestFocusOnUiThread(false); waitForSelectActionBarVisible(false); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); requestFocusOnUiThread(true); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); // Losing focus yet again should properly clear the selection. requestFocusOnUiThread(false); waitForSelectActionBarVisible(false); - assertFalse(mSelectionPopupController.hasSelection()); + Assert.assertFalse(mSelectionPopupController.hasSelection()); } + @Test @SmallTest @Feature({"TextSelection"}) @DisabledTest(message = "crbug.com/592428") public void testSelectionPreservedAfterReshown() throws Throwable { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); setVisibileOnUiThread(false); waitForSelectActionBarVisible(false); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); setVisibileOnUiThread(true); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); } + @Test @SmallTest @Feature({"TextSelection"}) @DisabledTest(message = "crbug.com/592428") public void testSelectionPreservedAfterReattached() throws Throwable { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); setAttachedOnUiThread(false); waitForSelectActionBarVisible(false); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); setAttachedOnUiThread(true); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); } /* @SmallTest @Feature({"TextInput"}) */ + @Test @DisabledTest(message = "https://crbug.com/592428") public void testPastePopupNotShownOnLongPressingNonEmptyInput() throws Throwable { copyStringToClipboard("SampleTextToCopy"); @@ -148,6 +161,7 @@ waitForPastePopupStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupClearedOnTappingEmptyInput() throws Throwable { @@ -158,6 +172,7 @@ waitForPastePopupStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupClearedOnTappingNonEmptyInput() throws Throwable { @@ -168,6 +183,7 @@ waitForPastePopupStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupClearedOnTappingOutsideInput() throws Throwable { @@ -178,6 +194,7 @@ waitForPastePopupStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupClearedOnLongPressingOutsideInput() throws Throwable { @@ -188,6 +205,7 @@ waitForPastePopupStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupNotShownOnLongPressingDisabledInput() throws Throwable { @@ -200,6 +218,7 @@ waitForInsertion(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupNoSelectAllEmptyInput() throws Throwable { @@ -208,9 +227,10 @@ DOMUtils.longPressNode(mContentViewCore, "empty_input_text"); waitForPastePopupStatus(true); waitForInsertion(true); - assertFalse(mSelectionPopupController.canSelectAll()); + Assert.assertFalse(mSelectionPopupController.canSelectAll()); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupCanSelectAllNonEmptyInput() throws Throwable { @@ -219,13 +239,14 @@ DOMUtils.longPressNode(mContentViewCore, "whitespace_input_text"); waitForPastePopupStatus(true); waitForInsertion(true); - assertTrue(mSelectionPopupController.canSelectAll()); + Assert.assertTrue(mSelectionPopupController.canSelectAll()); } /* @SmallTest @Feature({"TextInput"}) */ + @Test @DisabledTest(message = "https://crbug.com/592428") public void testPastePopupDismissedOnDestroy() throws Throwable { copyStringToClipboard("SampleTextToCopy"); @@ -240,229 +261,245 @@ waitForPastePopupStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testActionBarConfiguredCorrectlyForInput() throws Throwable { DOMUtils.longPressNode(mContentViewCore, "input_text"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); - assertTrue(mSelectionPopupController.isSelectionEditable()); - assertFalse(mSelectionPopupController.isSelectionPassword()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.isSelectionEditable()); + Assert.assertFalse(mSelectionPopupController.isSelectionPassword()); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testActionBarConfiguredCorrectlyForPassword() throws Throwable { DOMUtils.longPressNode(mContentViewCore, "password"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); - assertTrue(mSelectionPopupController.isSelectionEditable()); - assertTrue(mSelectionPopupController.isSelectionPassword()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.isSelectionEditable()); + Assert.assertTrue(mSelectionPopupController.isSelectionPassword()); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testActionBarConfiguredCorrectlyForPlainText() throws Throwable { DOMUtils.longPressNode(mContentViewCore, "plain_text_1"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); - assertFalse(mSelectionPopupController.isSelectionEditable()); - assertFalse(mSelectionPopupController.isSelectionPassword()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertFalse(mSelectionPopupController.isSelectionEditable()); + Assert.assertFalse(mSelectionPopupController.isSelectionPassword()); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testActionBarConfiguredCorrectlyForTextArea() throws Throwable { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); - assertTrue(mSelectionPopupController.isSelectionEditable()); - assertFalse(mSelectionPopupController.isSelectionPassword()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.isSelectionEditable()); + Assert.assertFalse(mSelectionPopupController.isSelectionPassword()); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarPlainTextCopy() throws Exception { DOMUtils.longPressNode(mContentViewCore, "plain_text_1"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCopy(); waitForClipboardContents(mContentViewCore.getContext(), "SamplePlainTextOne"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarInputCopy() throws Exception { DOMUtils.longPressNode(mContentViewCore, "input_text"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCopy(); waitForClipboardContents(mContentViewCore.getContext(), "SampleInputText"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarPasswordCopy() throws Exception { DOMUtils.longPressNode(mContentViewCore, "plain_text_1"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCopy(); waitForClipboardContents(mContentViewCore.getContext(), "SamplePlainTextOne"); DOMUtils.longPressNode(mContentViewCore, "password"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCopy(); // Copy option won't be there for Password, hence no change in Clipboard // Validating with previous Clipboard content waitForClipboardContents(mContentViewCore.getContext(), "SamplePlainTextOne"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarTextAreaCopy() throws Exception { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCopy(); waitForClipboardContents(mContentViewCore.getContext(), "SampleTextArea"); } + @Test @SmallTest @Feature({"TextSelection"}) @DisabledTest(message = "crbug.com/592428") - public void testSelectActionBarPlainTextCut() throws Exception { + public void testSelectActionBarPlainTextCut() throws Throwable { copyStringToClipboard("SampleTextToCopy"); DOMUtils.longPressNode(mContentViewCore, "plain_text_1"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertEquals(mSelectionPopupController.getSelectedText(), "SamplePlainTextOne"); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), "SamplePlainTextOne"); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCut(); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); // Cut option won't be available for plain text. // Hence validating previous Clipboard content. waitForClipboardContents(mContentViewCore.getContext(), "SampleTextToCopy"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarInputCut() throws Exception { DOMUtils.longPressNode(mContentViewCore, "input_text"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertEquals(mSelectionPopupController.getSelectedText(), "SampleInputText"); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), "SampleInputText"); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCut(); waitForSelectActionBarVisible(false); - assertFalse(mSelectionPopupController.hasSelection()); + Assert.assertFalse(mSelectionPopupController.hasSelection()); waitForClipboardContents(mContentViewCore.getContext(), "SampleInputText"); - assertEquals(mSelectionPopupController.getSelectedText(), ""); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), ""); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") - public void testSelectActionBarPasswordCut() throws Exception { + public void testSelectActionBarPasswordCut() throws Throwable { copyStringToClipboard("SampleTextToCopy"); DOMUtils.longPressNode(mContentViewCore, "password"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCut(); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); // Cut option won't be there for Password, hence no change in Clipboard // Validating with previous Clipboard content waitForClipboardContents(mContentViewCore.getContext(), "SampleTextToCopy"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarTextAreaCut() throws Exception { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextArea"); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextArea"); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarCut(); waitForSelectActionBarVisible(false); - assertFalse(mSelectionPopupController.hasSelection()); + Assert.assertFalse(mSelectionPopupController.hasSelection()); waitForClipboardContents(mContentViewCore.getContext(), "SampleTextArea"); - assertEquals(mSelectionPopupController.getSelectedText(), ""); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), ""); } + @Test @SmallTest @Feature({"TextSelection"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarPlainTextSelectAll() throws Exception { DOMUtils.longPressNode(mContentViewCore, "plain_text_1"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarSelectAll(); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); waitForSelectActionBarVisible(true); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarInputSelectAll() throws Exception { DOMUtils.longPressNode(mContentViewCore, "input_text"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarSelectAll(); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); waitForSelectActionBarVisible(true); - assertEquals(mSelectionPopupController.getSelectedText(), "SampleInputText"); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), "SampleInputText"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarPasswordSelectAll() throws Exception { DOMUtils.longPressNode(mContentViewCore, "password"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarSelectAll(); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); waitForSelectActionBarVisible(true); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarTextAreaSelectAll() throws Exception { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarSelectAll(); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); waitForSelectActionBarVisible(true); - assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextArea"); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextArea"); } private CharSequence getTextBeforeCursor(final int length, final int flags) { @@ -481,16 +518,17 @@ * @SmallTest * @Feature({"TextSelection", "TextInput"}) */ + @Test @DisabledTest(message = "http://crbug.com/606942") public void testCursorPositionAfterHidingActionMode() throws Exception { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarSelectAll(); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); waitForSelectActionBarVisible(true); - assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextArea"); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextArea"); hideSelectActionMode(); waitForSelectActionBarVisible(false); CriteriaHelper.pollInstrumentationThread( @@ -502,113 +540,118 @@ })); } + @Test @SmallTest @Feature({"TextSelection"}) @DisabledTest(message = "crbug.com/592428") - public void testSelectActionBarPlainTextPaste() throws Exception { + public void testSelectActionBarPlainTextPaste() throws Throwable { copyStringToClipboard("SampleTextToCopy"); DOMUtils.longPressNode(mContentViewCore, "plain_text_1"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarPaste(); DOMUtils.longPressNode(mContentViewCore, "plain_text_1"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); // Paste option won't be available for plain text. // Hence content won't be changed. - assertNotSame(mSelectionPopupController.getSelectedText(), "SampleTextToCopy"); + Assert.assertNotSame(mSelectionPopupController.getSelectedText(), "SampleTextToCopy"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") - public void testSelectActionBarInputPaste() throws Exception { + public void testSelectActionBarInputPaste() throws Throwable { copyStringToClipboard("SampleTextToCopy"); // Select the input field. DOMUtils.longPressNode(mContentViewCore, "input_text"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); // Paste into the input field. - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarPaste(); waitForSelectActionBarVisible(false); - assertFalse(mSelectionPopupController.hasSelection()); + Assert.assertFalse(mSelectionPopupController.hasSelection()); // Ensure the new text matches the pasted text. DOMUtils.longPressNode(mContentViewCore, "input_text"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertEquals("SampleTextToCopy", mSelectionPopupController.getSelectedText()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertEquals("SampleTextToCopy", mSelectionPopupController.getSelectedText()); } /* @SmallTest @Feature({"TextInput"}) */ + @Test @DisabledTest(message = "https://crbug.com/592428") - public void testSelectActionBarPasswordPaste() throws Exception { + public void testSelectActionBarPasswordPaste() throws Throwable { copyStringToClipboard("SamplePassword2"); // Select the password field. DOMUtils.longPressNode(mContentViewCore, "password"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertEquals(mSelectionPopupController.getSelectedText().length(), - "SamplePassword".length()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertEquals( + mSelectionPopupController.getSelectedText().length(), "SamplePassword".length()); // Paste "SamplePassword2" into the password field, replacing // "SamplePassword". - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarPaste(); waitForSelectActionBarVisible(false); - assertFalse(mSelectionPopupController.hasSelection()); + Assert.assertFalse(mSelectionPopupController.hasSelection()); // Ensure the new text matches the pasted text. Note that we can't // actually compare strings as password field selections only provide // a placeholder with the correct length. DOMUtils.longPressNode(mContentViewCore, "password"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertEquals(mSelectionPopupController.getSelectedText().length(), - "SamplePassword2".length()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertEquals( + mSelectionPopupController.getSelectedText().length(), "SamplePassword2".length()); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") - public void testSelectActionBarTextAreaPaste() throws Exception { + public void testSelectActionBarTextAreaPaste() throws Throwable { copyStringToClipboard("SampleTextToCopy"); DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarPaste(); DOMUtils.clickNode(mContentViewCore, "plain_text_1"); DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextToCopy"); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertEquals(mSelectionPopupController.getSelectedText(), "SampleTextToCopy"); } + @Test @SmallTest @Feature({"TextInput"}) @DisabledTest(message = "crbug.com/592428") public void testSelectActionBarSearchAndShareLaunchesNewTask() throws Exception { DOMUtils.longPressNode(mContentViewCore, "textarea"); waitForSelectActionBarVisible(true); - assertTrue(mSelectionPopupController.hasSelection()); - assertTrue(mSelectionPopupController.isActionModeValid()); + Assert.assertTrue(mSelectionPopupController.hasSelection()); + Assert.assertTrue(mSelectionPopupController.isActionModeValid()); selectActionBarSearch(); - Intent i = getActivity().getLastSentIntent(); + Intent i = mActivityTestRule.getActivity().getLastSentIntent(); int new_task_flag = Intent.FLAG_ACTIVITY_NEW_TASK; - assertEquals(i.getFlags() & new_task_flag, new_task_flag); + Assert.assertEquals(i.getFlags() & new_task_flag, new_task_flag); selectActionBarShare(); - i = getActivity().getLastSentIntent(); - assertEquals(i.getFlags() & new_task_flag, new_task_flag); + i = mActivityTestRule.getActivity().getLastSentIntent(); + Assert.assertEquals(i.getFlags() & new_task_flag, new_task_flag); } private void selectActionBarPaste() { @@ -734,12 +777,17 @@ }); } - private void copyStringToClipboard(String string) { - ClipboardManager clipboardManager = - (ClipboardManager) getActivity().getSystemService( - Context.CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText("test", string); - clipboardManager.setPrimaryClip(clip); + private void copyStringToClipboard(final String string) throws Throwable { + mActivityTestRule.runOnUiThread(new Runnable() { + @Override + public void run() { + ClipboardManager clipboardManager = + (ClipboardManager) mActivityTestRule.getActivity().getSystemService( + Context.CLIPBOARD_SERVICE); + ClipData clip = ClipData.newPlainText("test", string); + clipboardManager.setPrimaryClip(clip); + } + }); } private void waitForPastePopupStatus(final boolean show) {
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeActivityTestRule.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeActivityTestRule.java index ba3d5cf..4576cf03 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeActivityTestRule.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeActivityTestRule.java
@@ -7,6 +7,8 @@ import org.junit.runner.Description; import org.junit.runners.model.Statement; +import org.chromium.base.test.SetUpStatement; +import org.chromium.base.test.SetUpTestRule; import org.chromium.content.browser.test.util.TestCallbackHelperContainer; import org.chromium.content_shell_apk.ContentShellActivity; import org.chromium.content_shell_apk.ContentShellActivityTestRule; @@ -18,8 +20,10 @@ * ActivityTestRule with common functionality for testing the Java Bridge. */ public class JavaBridgeActivityTestRule - extends ContentShellActivityTestRule implements TestCommonCallback<ContentShellActivity> { + extends ContentShellActivityTestRule implements TestCommonCallback<ContentShellActivity>, + SetUpTestRule<JavaBridgeActivityTestRule> { private JavaBridgeTestCommon mTestCommon; + private boolean mSetup = false; public JavaBridgeActivityTestRule() { super(); @@ -29,7 +33,7 @@ /** * Sets up the ContentView. Intended to be called from setUp(). */ - private void setUpContentView() { + public void setUpContentView() { mTestCommon.setUpContentView(); } @@ -61,13 +65,19 @@ } @Override - public Statement apply(final Statement base, Description desc) { - return super.apply(new Statement() { - @Override - public void evaluate() throws Throwable { - setUpContentView(); - base.evaluate(); - } - }, desc); + public Statement apply(Statement base, Description desc) { + SetUpStatement setUpBase = new SetUpStatement(base, this, mSetup); + return super.apply(setUpBase, desc); + } + + @Override + public JavaBridgeActivityTestRule shouldSetUp(boolean runSetUp) { + mSetup = runSetUp; + return this; + } + + @Override + public void setUp() { + setUpContentView(); } }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayCoercionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayCoercionTest.java index 387c35f..ee67e07 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayCoercionTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayCoercionTest.java
@@ -33,7 +33,8 @@ private static final double ASSERTION_DELTA = 0; @Rule - public JavaBridgeActivityTestRule mActivityTestRule = new JavaBridgeActivityTestRule(); + public JavaBridgeActivityTestRule mActivityTestRule = + new JavaBridgeActivityTestRule().shouldSetUp(true); @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") private static class TestObject extends Controller {
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayTest.java index f4001b8..4c3963e 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeArrayTest.java
@@ -30,7 +30,8 @@ @RunWith(BaseJUnit4ClassRunner.class) public class JavaBridgeArrayTest { @Rule - public JavaBridgeActivityTestRule mActivityTestRule = new JavaBridgeActivityTestRule(); + public JavaBridgeActivityTestRule mActivityTestRule = + new JavaBridgeActivityTestRule().shouldSetUp(true); @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") private static class TestObject extends Controller {
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java index 1ea2e88..2bb4e89 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
@@ -6,14 +6,20 @@ import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; +import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; -import junit.framework.Assert; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import org.chromium.content.browser.JavaBridgeTestCommon.Controller; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.TestCallbackHelperContainer; import org.chromium.content_public.browser.LoadUrlParams; @@ -36,9 +42,14 @@ * - Threading * - Inheritance */ +@RunWith(ContentJUnit4ClassRunner.class) @SuppressFBWarnings( {"UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS", "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"}) -public class JavaBridgeBasicsTest extends JavaBridgeTestBase { +public class JavaBridgeBasicsTest { + @Rule + public JavaBridgeActivityTestRule mActivityTestRule = + new JavaBridgeActivityTestRule().shouldSetUp(false); + @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") private static class TestController extends Controller { private int mIntValue; @@ -93,23 +104,22 @@ TestController mTestController; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { + mActivityTestRule.setUpContentView(); mTestController = new TestController(); - injectObjectAndReload(mTestController, "testController"); + mActivityTestRule.injectObjectAndReload(mTestController, "testController"); } // Note that this requires that we can pass a JavaScript string to Java. protected String executeJavaScriptAndGetStringResult(String script) throws Throwable { - executeJavaScript("testController.setStringValue(" + script + ");"); + mActivityTestRule.executeJavaScript("testController.setStringValue(" + script + ");"); return mTestController.waitForStringValue(); } // Note that this requires that we can pass a JavaScript boolean to Java. private void executeAndSetIfException(String script) throws Throwable { - executeJavaScript("try {" - + script + ";" + mActivityTestRule.executeJavaScript("try {" + script + ";" + " testController.setBooleanValue(false);" + "} catch (exception) {" + " testController.setBooleanValue(true);" @@ -118,104 +128,116 @@ private void assertRaisesException(String script) throws Throwable { executeAndSetIfException(script); - assertTrue(mTestController.waitForBooleanValue()); + Assert.assertTrue(mTestController.waitForBooleanValue()); } private void assertNoRaisedException(String script) throws Throwable { executeAndSetIfException(script); - assertFalse(mTestController.waitForBooleanValue()); + Assert.assertFalse(mTestController.waitForBooleanValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testTypeOfInjectedObject() throws Throwable { - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testAdditionNotReflectedUntilReload() throws Throwable { - assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); - runTestOnUiThread(new Runnable() { + Assert.assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { - getContentViewCore().addPossiblyUnsafeJavascriptInterface( + mActivityTestRule.getContentViewCore().addPossiblyUnsafeJavascriptInterface( new Object(), "testObject", null); } }); - assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); - synchronousPageReload(); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); + Assert.assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); + mActivityTestRule.synchronousPageReload(); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testRemovalNotReflectedUntilReload() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public void method() { mTestController.setStringValue("I'm here"); } }, "testObject"); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); - executeJavaScript("testObject.method()"); - assertEquals("I'm here", mTestController.waitForStringValue()); - runTestOnUiThread(new Runnable() { + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); + mActivityTestRule.executeJavaScript("testObject.method()"); + Assert.assertEquals("I'm here", mTestController.waitForStringValue()); + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { - getContentViewCore().removeJavascriptInterface("testObject"); + mActivityTestRule.getContentViewCore().removeJavascriptInterface("testObject"); } }); // Check that the Java object is being held by the Java bridge, thus it's not // collected. Note that despite that what JavaDoc says about invoking "gc()", both Dalvik // and ART actually run the collector if called via Runtime. Runtime.getRuntime().gc(); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); - executeJavaScript("testObject.method()"); - assertEquals("I'm here", mTestController.waitForStringValue()); - synchronousPageReload(); - assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); + mActivityTestRule.executeJavaScript("testObject.method()"); + Assert.assertEquals("I'm here", mTestController.waitForStringValue()); + mActivityTestRule.synchronousPageReload(); + Assert.assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testRemoveObjectNotAdded() throws Throwable { TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper = - getTestCallBackHelperContainer().getOnPageFinishedHelper(); + mActivityTestRule.getTestCallBackHelperContainer().getOnPageFinishedHelper(); int currentCallCount = onPageFinishedHelper.getCallCount(); - runTestOnUiThread(new Runnable() { + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { - getContentViewCore().removeJavascriptInterface("foo"); - getContentViewCore().getWebContents().getNavigationController().reload(true); + mActivityTestRule.getContentViewCore().removeJavascriptInterface("foo"); + mActivityTestRule.getContentViewCore() + .getWebContents() + .getNavigationController() + .reload(true); } }); onPageFinishedHelper.waitForCallback(currentCallCount); - assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof foo")); + Assert.assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof foo")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testTypeOfMethod() throws Throwable { - assertEquals("function", + Assert.assertEquals("function", executeJavaScriptAndGetStringResult("typeof testController.setStringValue")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testTypeOfInvalidMethod() throws Throwable { - assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testController.foo")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testController.foo")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallingInvalidMethodRaisesException() throws Throwable { assertRaisesException("testController.foo()"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testUncaughtJavaExceptionRaisesJavaScriptException() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public void method() { throw new RuntimeException("foo"); } @@ -223,100 +245,112 @@ assertRaisesException("testObject.method()"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallingAsConstructorRaisesException() throws Throwable { assertRaisesException("new testController.setStringValue('foo')"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallingOnNonInjectedObjectRaisesException() throws Throwable { assertRaisesException("testController.setStringValue.call({}, 'foo')"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallingOnInstanceOfOtherClassRaisesException() throws Throwable { - injectObjectAndReload(new Object(), "testObject"); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); - assertEquals("function", + mActivityTestRule.injectObjectAndReload(new Object(), "testObject"); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); + Assert.assertEquals("function", executeJavaScriptAndGetStringResult("typeof testController.setStringValue")); assertRaisesException("testController.setStringValue.call(testObject, 'foo')"); } // Note that this requires that we can pass a JavaScript string to Java. + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testTypeOfStaticMethod() throws Throwable { - injectObjectAndReload(new ObjectWithStaticMethod(), "testObject"); - executeJavaScript("testController.setStringValue(typeof testObject.staticMethod)"); - assertEquals("function", mTestController.waitForStringValue()); + mActivityTestRule.injectObjectAndReload(new ObjectWithStaticMethod(), "testObject"); + mActivityTestRule.executeJavaScript( + "testController.setStringValue(typeof testObject.staticMethod)"); + Assert.assertEquals("function", mTestController.waitForStringValue()); } // Note that this requires that we can pass a JavaScript string to Java. + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallStaticMethod() throws Throwable { - injectObjectAndReload(new ObjectWithStaticMethod(), "testObject"); - executeJavaScript("testController.setStringValue(testObject.staticMethod())"); - assertEquals("foo", mTestController.waitForStringValue()); + mActivityTestRule.injectObjectAndReload(new ObjectWithStaticMethod(), "testObject"); + mActivityTestRule.executeJavaScript( + "testController.setStringValue(testObject.staticMethod())"); + Assert.assertEquals("foo", mTestController.waitForStringValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testPrivateMethodNotExposed() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { private void method() {} protected void method2() {} }, "testObject"); - assertEquals("undefined", - executeJavaScriptAndGetStringResult("typeof testObject.method")); - assertEquals("undefined", - executeJavaScriptAndGetStringResult("typeof testObject.method2")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testObject.method")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testObject.method2")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReplaceInjectedObject() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public void method() { mTestController.setStringValue("object 1"); } }, "testObject"); - executeJavaScript("testObject.method()"); - assertEquals("object 1", mTestController.waitForStringValue()); + mActivityTestRule.executeJavaScript("testObject.method()"); + Assert.assertEquals("object 1", mTestController.waitForStringValue()); - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public void method() { mTestController.setStringValue("object 2"); } }, "testObject"); - executeJavaScript("testObject.method()"); - assertEquals("object 2", mTestController.waitForStringValue()); + mActivityTestRule.executeJavaScript("testObject.method()"); + Assert.assertEquals("object 2", mTestController.waitForStringValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testInjectNullObjectIsIgnored() throws Throwable { - injectObjectAndReload(null, "testObject"); - assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); + mActivityTestRule.injectObjectAndReload(null, "testObject"); + Assert.assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReplaceInjectedObjectWithNullObjectIsIgnored() throws Throwable { - injectObjectAndReload(new Object(), "testObject"); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); - injectObjectAndReload(null, "testObject"); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); + mActivityTestRule.injectObjectAndReload(new Object(), "testObject"); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); + mActivityTestRule.injectObjectAndReload(null, "testObject"); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testObject")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallOverloadedMethodWithDifferentNumberOfArguments() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public void method() { mTestController.setStringValue("0 args"); } @@ -329,18 +363,19 @@ mTestController.setStringValue("2 args"); } }, "testObject"); - executeJavaScript("testObject.method()"); - assertEquals("0 args", mTestController.waitForStringValue()); - executeJavaScript("testObject.method(42)"); - assertEquals("1 arg", mTestController.waitForStringValue()); - executeJavaScript("testObject.method(null)"); - assertEquals("1 arg", mTestController.waitForStringValue()); - executeJavaScript("testObject.method(undefined)"); - assertEquals("1 arg", mTestController.waitForStringValue()); - executeJavaScript("testObject.method(42, 42)"); - assertEquals("2 args", mTestController.waitForStringValue()); + mActivityTestRule.executeJavaScript("testObject.method()"); + Assert.assertEquals("0 args", mTestController.waitForStringValue()); + mActivityTestRule.executeJavaScript("testObject.method(42)"); + Assert.assertEquals("1 arg", mTestController.waitForStringValue()); + mActivityTestRule.executeJavaScript("testObject.method(null)"); + Assert.assertEquals("1 arg", mTestController.waitForStringValue()); + mActivityTestRule.executeJavaScript("testObject.method(undefined)"); + Assert.assertEquals("1 arg", mTestController.waitForStringValue()); + mActivityTestRule.executeJavaScript("testObject.method(42, 42)"); + Assert.assertEquals("2 args", mTestController.waitForStringValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallMethodWithWrongNumberOfArgumentsRaisesException() throws Throwable { @@ -348,25 +383,29 @@ assertRaisesException("testController.setIntValue(42, 42)"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testObjectPersistsAcrossPageLoads() throws Throwable { - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); - synchronousPageReload(); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); + mActivityTestRule.synchronousPageReload(); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCustomPropertiesCleanedUpOnPageReloads() throws Throwable { - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); - executeJavaScript("testController.myProperty = 42;"); - assertEquals("42", executeJavaScriptAndGetStringResult("testController.myProperty")); - synchronousPageReload(); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); - assertEquals("undefined", executeJavaScriptAndGetStringResult("testController.myProperty")); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); + mActivityTestRule.executeJavaScript("testController.myProperty = 42;"); + Assert.assertEquals("42", executeJavaScriptAndGetStringResult("testController.myProperty")); + mActivityTestRule.synchronousPageReload(); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof testController")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("testController.myProperty")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testSameObjectInjectedMultipleTimes() throws Throwable { @@ -378,17 +417,19 @@ } } final TestObject testObject = new TestObject(); - injectObjectsAndReload(testObject, "testObject1", testObject, "testObject2", null); - executeJavaScript("testObject1.method()"); - assertEquals(1, mTestController.waitForIntValue()); - executeJavaScript("testObject2.method()"); - assertEquals(2, mTestController.waitForIntValue()); + mActivityTestRule.injectObjectsAndReload( + testObject, "testObject1", testObject, "testObject2", null); + mActivityTestRule.executeJavaScript("testObject1.method()"); + Assert.assertEquals(1, mTestController.waitForIntValue()); + mActivityTestRule.executeJavaScript("testObject2.method()"); + Assert.assertEquals(2, mTestController.waitForIntValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCallMethodOnReturnedObject() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public Object getInnerObject() { return new Object() { public void method(int x) { @@ -397,10 +438,11 @@ }; } }, "testObject"); - executeJavaScript("testObject.getInnerObject().method(42)"); - assertEquals(42, mTestController.waitForIntValue()); + mActivityTestRule.executeJavaScript("testObject.getInnerObject().method(42)"); + Assert.assertEquals(42, mTestController.waitForIntValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReturnedObjectInjectedElsewhere() throws Throwable { @@ -417,23 +459,24 @@ return innerObject; } }; - injectObjectsAndReload(object, "testObject", innerObject, "innerObject", null); - executeJavaScript("testObject.getInnerObject().method()"); - assertEquals(1, mTestController.waitForIntValue()); - executeJavaScript("innerObject.method()"); - assertEquals(2, mTestController.waitForIntValue()); + mActivityTestRule.injectObjectsAndReload( + object, "testObject", innerObject, "innerObject", null); + mActivityTestRule.executeJavaScript("testObject.getInnerObject().method()"); + Assert.assertEquals(1, mTestController.waitForIntValue()); + mActivityTestRule.executeJavaScript("innerObject.method()"); + Assert.assertEquals(2, mTestController.waitForIntValue()); } // Verify that Java objects returned from bridge object methods are dereferenced // on the Java side once they have been fully dereferenced on the JS side. // Failing this test would mean that methods returning objects effectively create a memory // leak. + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) @CommandLineFlags.Add("js-flags=--expose-gc") public void testReturnedObjectIsGarbageCollected() throws Throwable { - // Make sure V8 exposes "gc" property on the global object (enabled with --expose-gc flag) - assertEquals("function", executeJavaScriptAndGetStringResult("typeof gc")); + Assert.assertEquals("function", executeJavaScriptAndGetStringResult("typeof gc")); class InnerObject { } class TestObject { @@ -446,30 +489,31 @@ WeakReference<InnerObject> mWeakRefForInner; } TestObject object = new TestObject(); - injectObjectAndReload(object, "testObject"); + mActivityTestRule.injectObjectAndReload(object, "testObject"); // Initially, store a reference to the inner object in JS to make sure it's not // garbage-collected prematurely. - assertEquals("object", executeJavaScriptAndGetStringResult( - "(function() { " + Assert.assertEquals("object", + executeJavaScriptAndGetStringResult("(function() { " + "globalInner = testObject.getInnerObject(); return typeof globalInner; " + "})()")); - assertTrue(object.mWeakRefForInner.get() != null); + Assert.assertTrue(object.mWeakRefForInner.get() != null); // Check that returned Java object is being held by the Java bridge, thus it's not // collected. Note that despite that what JavaDoc says about invoking "gc()", both Dalvik // and ART actually run the collector. Runtime.getRuntime().gc(); - assertTrue(object.mWeakRefForInner.get() != null); + Assert.assertTrue(object.mWeakRefForInner.get() != null); // Now dereference the inner object in JS and run GC to collect the interface object. - assertEquals("true", executeJavaScriptAndGetStringResult( - "(function() { " + Assert.assertEquals("true", + executeJavaScriptAndGetStringResult("(function() { " + "delete globalInner; gc(); return (typeof globalInner == 'undefined'); " + "})()")); // Force GC on the Java side again. The bridge had to release the inner object, so it must // be collected this time. Runtime.getRuntime().gc(); - assertEquals(null, object.mWeakRefForInner.get()); + Assert.assertEquals(null, object.mWeakRefForInner.get()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testSameReturnedObjectUsesSameWrapper() throws Throwable { @@ -481,33 +525,35 @@ return innerObject; } }; - injectObjectAndReload(injectedTestObject, "injectedTestObject"); - executeJavaScript("inner1 = injectedTestObject.getInnerObject()"); - executeJavaScript("inner2 = injectedTestObject.getInnerObject()"); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof inner1")); - assertEquals("object", executeJavaScriptAndGetStringResult("typeof inner2")); - assertEquals("true", executeJavaScriptAndGetStringResult("inner1 === inner2")); + mActivityTestRule.injectObjectAndReload(injectedTestObject, "injectedTestObject"); + mActivityTestRule.executeJavaScript("inner1 = injectedTestObject.getInnerObject()"); + mActivityTestRule.executeJavaScript("inner2 = injectedTestObject.getInnerObject()"); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof inner1")); + Assert.assertEquals("object", executeJavaScriptAndGetStringResult("typeof inner2")); + Assert.assertEquals("true", executeJavaScriptAndGetStringResult("inner1 === inner2")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testMethodInvokedOnBackgroundThread() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public void captureThreadId() { mTestController.setLongValue(Thread.currentThread().getId()); } }, "testObject"); - executeJavaScript("testObject.captureThreadId()"); + mActivityTestRule.executeJavaScript("testObject.captureThreadId()"); final long threadId = mTestController.waitForLongValue(); - assertFalse(threadId == Thread.currentThread().getId()); - runTestOnUiThread(new Runnable() { + Assert.assertFalse(threadId == Thread.currentThread().getId()); + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { - assertFalse(threadId == Thread.currentThread().getId()); + Assert.assertFalse(threadId == Thread.currentThread().getId()); } }); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testBlockingUiThreadDoesNotBlockCallsFromJs() throws Throwable { @@ -526,8 +572,8 @@ } } final TestObject testObject = new TestObject(); - injectObjectAndReload(testObject, "testObject"); - runTestOnUiThread(new Runnable() { + mActivityTestRule.injectObjectAndReload(testObject, "testObject"); + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { // loadUrl is asynchronous, the JS code will start running on the renderer @@ -536,19 +582,21 @@ // to "unlockTheLatch()" will be executed after the waiting timeout, thus the // string value will not yet be updated by the injected object. mTestController.setStringValue("locked"); - getWebContents().getNavigationController().loadUrl(new LoadUrlParams( - "javascript:(function() { testObject.unlockTheLatch() })()")); + mActivityTestRule.getWebContents().getNavigationController().loadUrl( + new LoadUrlParams( + "javascript:(function() { testObject.unlockTheLatch() })()")); try { - assertTrue(testObject.waitOnTheLatch()); + Assert.assertTrue(testObject.waitOnTheLatch()); } catch (Exception e) { android.util.Log.e("JavaBridgeBasicsTest", "Wait exception", e); Assert.fail("Wait exception"); } - assertEquals("unlocked", mTestController.getStringValue()); + Assert.assertEquals("unlocked", mTestController.getStringValue()); } }); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testPublicInheritedMethod() throws Throwable { @@ -559,12 +607,14 @@ } class Derived extends Base { } - injectObjectAndReload(new Derived(), "testObject"); - assertEquals("function", executeJavaScriptAndGetStringResult("typeof testObject.method")); - executeJavaScript("testObject.method(42)"); - assertEquals(42, mTestController.waitForIntValue()); + mActivityTestRule.injectObjectAndReload(new Derived(), "testObject"); + Assert.assertEquals( + "function", executeJavaScriptAndGetStringResult("typeof testObject.method")); + mActivityTestRule.executeJavaScript("testObject.method(42)"); + Assert.assertEquals(42, mTestController.waitForIntValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testPrivateInheritedMethod() throws Throwable { @@ -573,10 +623,12 @@ } class Derived extends Base { } - injectObjectAndReload(new Derived(), "testObject"); - assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof testObject.method")); + mActivityTestRule.injectObjectAndReload(new Derived(), "testObject"); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testObject.method")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testOverriddenMethod() throws Throwable { @@ -591,15 +643,16 @@ mTestController.setStringValue("derived"); } } - injectObjectAndReload(new Derived(), "testObject"); - executeJavaScript("testObject.method()"); - assertEquals("derived", mTestController.waitForStringValue()); + mActivityTestRule.injectObjectAndReload(new Derived(), "testObject"); + mActivityTestRule.executeJavaScript("testObject.method()"); + Assert.assertEquals("derived", mTestController.waitForStringValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testEnumerateMembers() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public void method() {} private void privateMethod() {} @SuppressFBWarnings("UUF_UNUSED") @@ -607,18 +660,18 @@ @SuppressFBWarnings("UUF_UNUSED") private int mPrivateField; }, "testObject"); - executeJavaScript( - "var result = \"\"; " + mActivityTestRule.executeJavaScript("var result = \"\"; " + "for (x in testObject) { result += \" \" + x } " + "testController.setStringValue(result);"); - assertEquals(" equals getClass hashCode method notify notifyAll toString wait", + Assert.assertEquals(" equals getClass hashCode method notify notifyAll toString wait", mTestController.waitForStringValue()); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReflectPublicMethod() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public Class<?> myGetClass() { return getClass(); } @@ -627,29 +680,33 @@ return "foo"; } }, "testObject"); - assertEquals("foo", executeJavaScriptAndGetStringResult( - "testObject.myGetClass().getMethod('method', null).invoke(testObject, null)" - + ".toString()")); + Assert.assertEquals("foo", + executeJavaScriptAndGetStringResult( + "testObject.myGetClass().getMethod('method', null).invoke(testObject, null)" + + ".toString()")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReflectPublicField() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public Class<?> myGetClass() { return getClass(); } public String field = "foo"; }, "testObject"); - assertEquals("foo", executeJavaScriptAndGetStringResult( - "testObject.myGetClass().getField('field').get(testObject).toString()")); + Assert.assertEquals("foo", + executeJavaScriptAndGetStringResult( + "testObject.myGetClass().getField('field').get(testObject).toString()")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReflectPrivateMethodRaisesException() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public Class<?> myGetClass() { return getClass(); } @@ -664,10 +721,11 @@ + "invoke(testObject, null)"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReflectPrivateFieldRaisesException() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public Class<?> myGetClass() { return getClass(); } @@ -684,26 +742,29 @@ "testObject.myGetClass().getDeclaredField('" + fieldName + "').getInt(testObject)"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testAllowNonAnnotatedMethods() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { public String allowed() { return "foo"; } }, "testObject", null); // Test calling a method of an explicitly inherited class (Base#allowed()). - assertEquals("foo", executeJavaScriptAndGetStringResult("testObject.allowed()")); + Assert.assertEquals("foo", executeJavaScriptAndGetStringResult("testObject.allowed()")); // Test calling a method of an implicitly inherited class (Object#toString()). - assertEquals("string", executeJavaScriptAndGetStringResult("typeof testObject.toString()")); + Assert.assertEquals( + "string", executeJavaScriptAndGetStringResult("typeof testObject.toString()")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testAllowOnlyAnnotatedMethods() throws Throwable { - injectObjectAndReload(new Object() { + mActivityTestRule.injectObjectAndReload(new Object() { @JavascriptInterface public String allowed() { return "foo"; @@ -717,20 +778,21 @@ // getClass() is an Object method and does not have the @JavascriptInterface annotation and // should not be able to be called. assertRaisesException("testObject.getClass()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof testObject.getClass")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testObject.getClass")); // allowed() is marked with the @JavascriptInterface annotation and should be allowed to be // called. - assertEquals("foo", executeJavaScriptAndGetStringResult("testObject.allowed()")); + Assert.assertEquals("foo", executeJavaScriptAndGetStringResult("testObject.allowed()")); // disallowed() is not marked with the @JavascriptInterface annotation and should not be // able to be called. assertRaisesException("testObject.disallowed()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof testObject.disallowed")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testObject.disallowed")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testAnnotationRequirementRetainsPropertyAcrossObjects() throws Throwable { @@ -753,32 +815,34 @@ } // First test with safe mode off. - injectObjectAndReload(new TestReturner(), "unsafeTestObject", null); + mActivityTestRule.injectObjectAndReload(new TestReturner(), "unsafeTestObject", null); // safe() should be able to be called regardless of whether or not we are in safe mode. - assertEquals("foo", executeJavaScriptAndGetStringResult( - "unsafeTestObject.getTest().safe()")); + Assert.assertEquals( + "foo", executeJavaScriptAndGetStringResult("unsafeTestObject.getTest().safe()")); // unsafe() should be able to be called because we are not in safe mode. - assertEquals("bar", executeJavaScriptAndGetStringResult( - "unsafeTestObject.getTest().unsafe()")); + Assert.assertEquals( + "bar", executeJavaScriptAndGetStringResult("unsafeTestObject.getTest().unsafe()")); // Now test with safe mode on. - injectObjectAndReload(new TestReturner(), "safeTestObject", JavascriptInterface.class); + mActivityTestRule.injectObjectAndReload( + new TestReturner(), "safeTestObject", JavascriptInterface.class); // safe() should be able to be called regardless of whether or not we are in safe mode. - assertEquals("foo", executeJavaScriptAndGetStringResult( - "safeTestObject.getTest().safe()")); + Assert.assertEquals( + "foo", executeJavaScriptAndGetStringResult("safeTestObject.getTest().safe()")); // unsafe() should not be able to be called because we are in safe mode. assertRaisesException("safeTestObject.getTest().unsafe()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof safeTestObject.getTest().unsafe")); + Assert.assertEquals("undefined", + executeJavaScriptAndGetStringResult("typeof safeTestObject.getTest().unsafe")); // getClass() is an Object method and does not have the @JavascriptInterface annotation and // should not be able to be called. assertRaisesException("safeTestObject.getTest().getClass()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof safeTestObject.getTest().getClass")); + Assert.assertEquals("undefined", + executeJavaScriptAndGetStringResult("typeof safeTestObject.getTest().getClass")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testAnnotationDoesNotGetInherited() throws Throwable { @@ -792,13 +856,14 @@ public void base() { } } - injectObjectAndReload(new Child(), "testObject", JavascriptInterface.class); + mActivityTestRule.injectObjectAndReload( + new Child(), "testObject", JavascriptInterface.class); // base() is inherited. The inherited method does not have the @JavascriptInterface // annotation and should not be able to be called. assertRaisesException("testObject.base()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof testObject.base")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testObject.base")); } @SuppressWarnings("javadoc") @@ -807,6 +872,7 @@ @interface TestAnnotation { } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testCustomAnnotationRestriction() throws Throwable { @@ -823,30 +889,36 @@ } // Inject javascriptInterfaceObj and require the JavascriptInterface annotation. - injectObjectAndReload(new Test(), "javascriptInterfaceObj", JavascriptInterface.class); + mActivityTestRule.injectObjectAndReload( + new Test(), "javascriptInterfaceObj", JavascriptInterface.class); // Test#testAnnotationFoo() should fail, as it isn't annotated with JavascriptInterface. assertRaisesException("javascriptInterfaceObj.checkTestAnnotationFoo()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof javascriptInterfaceObj.checkTestAnnotationFoo")); + Assert.assertEquals("undefined", + executeJavaScriptAndGetStringResult( + "typeof javascriptInterfaceObj.checkTestAnnotationFoo")); // Test#javascriptInterfaceFoo() should pass, as it is annotated with JavascriptInterface. - assertEquals("bar", executeJavaScriptAndGetStringResult( - "javascriptInterfaceObj.checkJavascriptInterfaceFoo()")); + Assert.assertEquals("bar", + executeJavaScriptAndGetStringResult( + "javascriptInterfaceObj.checkJavascriptInterfaceFoo()")); // Inject testAnnotationObj and require the TestAnnotation annotation. - injectObjectAndReload(new Test(), "testAnnotationObj", TestAnnotation.class); + mActivityTestRule.injectObjectAndReload( + new Test(), "testAnnotationObj", TestAnnotation.class); // Test#testAnnotationFoo() should pass, as it is annotated with TestAnnotation. - assertEquals("bar", executeJavaScriptAndGetStringResult( - "testAnnotationObj.checkTestAnnotationFoo()")); + Assert.assertEquals("bar", + executeJavaScriptAndGetStringResult("testAnnotationObj.checkTestAnnotationFoo()")); // Test#javascriptInterfaceFoo() should fail, as it isn't annotated with TestAnnotation. assertRaisesException("testAnnotationObj.checkJavascriptInterfaceFoo()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof testAnnotationObj.checkJavascriptInterfaceFoo")); + Assert.assertEquals("undefined", + executeJavaScriptAndGetStringResult( + "typeof testAnnotationObj.checkJavascriptInterfaceFoo")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testAddJavascriptInterfaceIsSafeByDefault() throws Throwable { @@ -864,28 +936,31 @@ // Manually inject the Test object, making sure to use the // ContentViewCore#addJavascriptInterface, not the possibly unsafe version. TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper = - getTestCallBackHelperContainer().getOnPageFinishedHelper(); + mActivityTestRule.getTestCallBackHelperContainer().getOnPageFinishedHelper(); int currentCallCount = onPageFinishedHelper.getCallCount(); - runTestOnUiThread(new Runnable() { + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { - getContentViewCore().addJavascriptInterface(new Test(), - "testObject"); - getContentViewCore().getWebContents().getNavigationController().reload(true); + mActivityTestRule.getContentViewCore().addJavascriptInterface( + new Test(), "testObject"); + mActivityTestRule.getContentViewCore() + .getWebContents() + .getNavigationController() + .reload(true); } }); onPageFinishedHelper.waitForCallback(currentCallCount); // Test#allowed() should pass, as it is annotated with JavascriptInterface. - assertEquals("bar", executeJavaScriptAndGetStringResult( - "testObject.allowed()")); + Assert.assertEquals("bar", executeJavaScriptAndGetStringResult("testObject.allowed()")); // Test#blocked() should fail, as it isn't annotated with JavascriptInterface. assertRaisesException("testObject.blocked()"); - assertEquals("undefined", executeJavaScriptAndGetStringResult( - "typeof testObject.blocked")); + Assert.assertEquals( + "undefined", executeJavaScriptAndGetStringResult("typeof testObject.blocked")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testObjectsInspection() throws Throwable { @@ -915,36 +990,46 @@ final String nonInspectableObjectName = "testObj2"; // Inspection is enabled by default. - injectObjectAndReload(new Test(), inspectableObjectName, JavascriptInterface.class); + mActivityTestRule.injectObjectAndReload( + new Test(), inspectableObjectName, JavascriptInterface.class); - assertEquals("m1,m2", executeJavaScriptAndGetStringResult( + Assert.assertEquals("m1,m2", + executeJavaScriptAndGetStringResult( String.format(jsObjectKeysTestTemplate, inspectableObjectName))); - assertEquals("m1,m2", executeJavaScriptAndGetStringResult( + Assert.assertEquals("m1,m2", + executeJavaScriptAndGetStringResult( String.format(jsForInTestTemplate, inspectableObjectName))); - runTestOnUiThread(new Runnable() { + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { - getContentViewCore().setAllowJavascriptInterfacesInspection(false); + mActivityTestRule.getContentViewCore().setAllowJavascriptInterfacesInspection( + false); } }); - injectObjectAndReload(new Test(), nonInspectableObjectName, JavascriptInterface.class); + mActivityTestRule.injectObjectAndReload( + new Test(), nonInspectableObjectName, JavascriptInterface.class); - assertEquals("", executeJavaScriptAndGetStringResult( + Assert.assertEquals("", + executeJavaScriptAndGetStringResult( String.format(jsObjectKeysTestTemplate, nonInspectableObjectName))); - assertEquals("", executeJavaScriptAndGetStringResult( + Assert.assertEquals("", + executeJavaScriptAndGetStringResult( String.format(jsForInTestTemplate, nonInspectableObjectName))); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testAccessToObjectGetClassIsBlocked() throws Throwable { - injectObjectAndReload(new Object(), "testObject"); - assertEquals("function", executeJavaScriptAndGetStringResult("typeof testObject.getClass")); + mActivityTestRule.injectObjectAndReload(new Object(), "testObject"); + Assert.assertEquals( + "function", executeJavaScriptAndGetStringResult("typeof testObject.getClass")); assertRaisesException("testObject.getClass()"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testReplaceJavascriptInterface() throws Throwable { @@ -958,15 +1043,16 @@ } private int mValue; } - injectObjectAndReload(new Test(13), "testObject"); - assertEquals("13", executeJavaScriptAndGetStringResult("testObject.getValue()")); + mActivityTestRule.injectObjectAndReload(new Test(13), "testObject"); + Assert.assertEquals("13", executeJavaScriptAndGetStringResult("testObject.getValue()")); // The documentation doesn't specify, what happens if the embedder is trying // to inject a different object under the same name. The current implementation // simply replaces the old object with the new one. - injectObjectAndReload(new Test(42), "testObject"); - assertEquals("42", executeJavaScriptAndGetStringResult("testObject.getValue()")); + mActivityTestRule.injectObjectAndReload(new Test(42), "testObject"); + Assert.assertEquals("42", executeJavaScriptAndGetStringResult("testObject.getValue()")); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testMethodCalledOnAnotherInstance() throws Throwable { @@ -981,14 +1067,15 @@ } final TestObject testObject1 = new TestObject(1); final TestObject testObject2 = new TestObject(2); - injectObjectsAndReload(testObject1, "testObject1", testObject2, "testObject2", null); - executeJavaScript("testObject1.method()"); - assertEquals(1, mTestController.waitForIntValue()); - executeJavaScript("testObject2.method()"); - assertEquals(2, mTestController.waitForIntValue()); - executeJavaScript("testObject1.method.call(testObject2)"); - assertEquals(2, mTestController.waitForIntValue()); - executeJavaScript("testObject2.method.call(testObject1)"); - assertEquals(1, mTestController.waitForIntValue()); + mActivityTestRule.injectObjectsAndReload( + testObject1, "testObject1", testObject2, "testObject2", null); + mActivityTestRule.executeJavaScript("testObject1.method()"); + Assert.assertEquals(1, mTestController.waitForIntValue()); + mActivityTestRule.executeJavaScript("testObject2.method()"); + Assert.assertEquals(2, mTestController.waitForIntValue()); + mActivityTestRule.executeJavaScript("testObject1.method.call(testObject2)"); + Assert.assertEquals(2, mTestController.waitForIntValue()); + mActivityTestRule.executeJavaScript("testObject2.method.call(testObject1)"); + Assert.assertEquals(1, mTestController.waitForIntValue()); } }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java index cbad6a1d42..ad32fc6 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java
@@ -4,14 +4,22 @@ package org.chromium.content.browser; +import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.RetryOnFailure; import org.chromium.content.browser.JavaBridgeTestCommon.Controller; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content_public.browser.JavaScriptCallback; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.NavigationController; @@ -28,8 +36,13 @@ * Ensures that injected objects are exposed to child frames as well as the * main frame. */ +@RunWith(ContentJUnit4ClassRunner.class) @SuppressFBWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS") -public class JavaBridgeChildFrameTest extends JavaBridgeTestBase { +public class JavaBridgeChildFrameTest { + @Rule + public JavaBridgeActivityTestRule mActivityTestRule = + new JavaBridgeActivityTestRule().shouldSetUp(true); + @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") private static class TestController extends Controller { private String mStringValue; @@ -48,33 +61,35 @@ TestController mTestController; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { mTestController = new TestController(); - injectObjectAndReload(mTestController, "testController"); + mActivityTestRule.injectObjectAndReload(mTestController, "testController"); } + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testInjectedObjectPresentInChildFrame() throws Throwable { - loadDataSync(getWebContents().getNavigationController(), + loadDataSync(mActivityTestRule.getWebContents().getNavigationController(), "<html><body><iframe></iframe></body></html>", "text/html", false); // We are not executing this code as a part of page loading routine to avoid races // with internal Blink events that notify Java Bridge about window object updates. - assertEquals("\"object\"", executeJavaScriptAndGetResult( - getWebContents(), "typeof window.frames[0].testController")); - executeJavaScriptAndGetResult( - getWebContents(), "window.frames[0].testController.setStringValue('PASS')"); - assertEquals("PASS", mTestController.waitForStringValue()); + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult(mActivityTestRule.getWebContents(), + "typeof window.frames[0].testController")); + executeJavaScriptAndGetResult(mActivityTestRule.getWebContents(), + "window.frames[0].testController.setStringValue('PASS')"); + Assert.assertEquals("PASS", mTestController.waitForStringValue()); } // Verify that loading an iframe doesn't ruin JS wrapper of the main page. // This is a regression test for the problem described in b/15572824. + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testMainPageWrapperIsNotBrokenByChildFrame() throws Throwable { - loadDataSync(getWebContents().getNavigationController(), + loadDataSync(mActivityTestRule.getWebContents().getNavigationController(), "<html><body><iframe></iframe></body></html>", "text/html", false); // In case there is anything wrong with the JS wrapper, an attempt // to look up its properties will result in an exception being thrown. @@ -83,22 +98,23 @@ + "} catch (e) {" + " return e.toString();" + "} })()"; - assertEquals("\"function\"", - executeJavaScriptAndGetResult(getWebContents(), script)); + Assert.assertEquals("\"function\"", + executeJavaScriptAndGetResult(mActivityTestRule.getWebContents(), script)); // Make sure calling a method also works. - executeJavaScriptAndGetResult(getWebContents(), - "testController.setStringValue('PASS');"); - assertEquals("PASS", mTestController.waitForStringValue()); + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "testController.setStringValue('PASS');"); + Assert.assertEquals("PASS", mTestController.waitForStringValue()); } // Verify that parent page and child frame each has own JS wrapper object. // Failing to do so exposes parent's context to the child. + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) public void testWrapperIsNotSharedWithChildFrame() throws Throwable { // Test by setting a custom property on the parent page's injected // object and then checking that child frame doesn't see the property. - loadDataSync(getWebContents().getNavigationController(), + loadDataSync(mActivityTestRule.getWebContents().getNavigationController(), "<html><head>" + "<script>" + " window.wProperty = 42;" @@ -107,17 +123,20 @@ + " return w.wProperty + ' / ' + w.testController.tcProperty;" + " }" + "</script>" - + "</head><body><iframe></iframe></body></html>", "text/html", false); - assertEquals("\"42 / 42\"", - executeJavaScriptAndGetResult(getWebContents(), "queryProperties(window)")); - assertEquals("\"undefined / undefined\"", - executeJavaScriptAndGetResult(getWebContents(), - "queryProperties(window.frames[0])")); + + "</head><body><iframe></iframe></body></html>", + "text/html", false); + Assert.assertEquals("\"42 / 42\"", + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "queryProperties(window)")); + Assert.assertEquals("\"undefined / undefined\"", + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "queryProperties(window.frames[0])")); } // Regression test for crbug.com/484927 -- make sure that existence of transient // objects held by multiple RenderFrames doesn't cause an infinite loop when one // of them gets removed. + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) @DisabledTest(message = "https://crbug.com/677182") @@ -144,38 +163,41 @@ // all the frames got created, then inject the object. // Thus, the script code fails on the first execution (as no Java object is // injected yet), but then works just fine after reload. - loadDataSync(getWebContents().getNavigationController(), + loadDataSync(mActivityTestRule.getWebContents().getNavigationController(), "<html>" - + "<head><script>window.inner_ref = test.getInner()</script></head>" - + "<body>" - + " <iframe id='frame' " - + " srcdoc='<script>window.inner_ref = test.getInner()</script>'>" - + " </iframe>" - + "</body></html>", "text/html", false); - injectObjectAndReload(testObject, "test"); + + "<head><script>window.inner_ref = test.getInner()</script></head>" + + "<body>" + + " <iframe id='frame' " + + " srcdoc='<script>window.inner_ref = test.getInner()</script>'>" + + " </iframe>" + + "</body></html>", + "text/html", false); + mActivityTestRule.injectObjectAndReload(testObject, "test"); testObject.waitForInjection(); // Just in case, check that the object wrappers are in place. - assertEquals("\"object\"", - executeJavaScriptAndGetResult(getWebContents(), "typeof inner_ref")); - assertEquals("\"object\"", - executeJavaScriptAndGetResult(getWebContents(), - "typeof window.frames[0].inner_ref")); + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "typeof inner_ref")); + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "typeof window.frames[0].inner_ref")); // Remove the iframe, this will trigger a removal of RenderFrame, which was causing // the bug condition, as the transient object still has a holder -- the main window. - assertEquals("\"object\"", - executeJavaScriptAndGetResult(getWebContents(), + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult(mActivityTestRule.getWebContents(), "(function(){ " - + "var f = document.getElementById('frame');" - + "f.parentNode.removeChild(f); return typeof f; })()")); + + "var f = document.getElementById('frame');" + + "f.parentNode.removeChild(f); return typeof f; })()")); // Just in case, check that the remaining wrapper is still accessible. - assertEquals("\"object\"", - executeJavaScriptAndGetResult(getWebContents(), - "typeof inner_ref")); + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "typeof inner_ref")); } // Regression test for crbug.com/486245 -- assign ownership of a transient object // to one frame with a code running in the second frame. Deletion of the second // frame should not affect the injected object. + @Test @SmallTest @Feature({"AndroidWebView", "Android-JavaBridge"}) @CommandLineFlags.Add("js-flags=--expose-gc") @@ -200,55 +222,59 @@ } final Test testObject = new Test(); - assertEquals("\"function\"", executeJavaScriptAndGetResult(getWebContents(), "typeof gc")); + Assert.assertEquals("\"function\"", + executeJavaScriptAndGetResult(mActivityTestRule.getWebContents(), "typeof gc")); // The page executes in the second frame code which creates a wrapper for a transient // injected object, but makes the first frame the owner of the object. - loadDataSync(getWebContents().getNavigationController(), + loadDataSync(mActivityTestRule.getWebContents().getNavigationController(), "<html>" - + "<head></head>" - + "<body>" - + " <iframe id='frame1' " - + " srcdoc='<body>I am the Inner object owner!</body>'>" - + " </iframe>" - + " <iframe id='frame2' " - + " srcdoc='<script>" - + " window.parent.frames[0].inner_ref = test.getInner()" - + " </script>'>" - + " </iframe>" - + "</body></html>", "text/html", false); - injectObjectAndReload(testObject, "test"); + + "<head></head>" + + "<body>" + + " <iframe id='frame1' " + + " srcdoc='<body>I am the Inner object owner!</body>'>" + + " </iframe>" + + " <iframe id='frame2' " + + " srcdoc='<script>" + + " window.parent.frames[0].inner_ref = test.getInner()" + + " </script>'>" + + " </iframe>" + + "</body></html>", + "text/html", false); + mActivityTestRule.injectObjectAndReload(testObject, "test"); testObject.waitForInjection(); // Check that the object wrappers are in place. - assertTrue(testObject.mWeakRefForInner.get() != null); - assertEquals("\"object\"", - executeJavaScriptAndGetResult(getWebContents(), - "typeof window.frames[0].inner_ref")); + Assert.assertTrue(testObject.mWeakRefForInner.get() != null); + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "typeof window.frames[0].inner_ref")); // Remove the second frame. This must not toggle the deletion of the inner // object. - assertEquals("\"object\"", - executeJavaScriptAndGetResult(getWebContents(), + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult(mActivityTestRule.getWebContents(), "(function(){ " - + "var f = document.getElementById('frame2');" - + "f.parentNode.removeChild(f); return typeof f; })()")); + + "var f = document.getElementById('frame2');" + + "f.parentNode.removeChild(f); return typeof f; })()")); // Perform two major GCs at the end to flush out all wrappers // and other Blink (Oilpan) objects. - executeJavaScriptAndGetResult(getWebContents(), "for (var i = 0; i < 2; ++i) gc();"); + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "for (var i = 0; i < 2; ++i) gc();"); // Check that returned Java object is being held by the Java bridge, thus it's not // collected. Note that despite that what JavaDoc says about invoking "gc()", both Dalvik // and ART actually run the collector. Runtime.getRuntime().gc(); - assertNotNull(testObject.mWeakRefForInner.get()); + Assert.assertNotNull(testObject.mWeakRefForInner.get()); // Now, remove the first frame and GC. As it was the only holder of the // inner object's wrapper, the wrapper must be collected. Then, the death // of the wrapper must cause removal of the inner object. - assertEquals("\"object\"", - executeJavaScriptAndGetResult(getWebContents(), + Assert.assertEquals("\"object\"", + executeJavaScriptAndGetResult(mActivityTestRule.getWebContents(), "(function(){ " - + "var f = document.getElementById('frame1');" - + "f.parentNode.removeChild(f); return typeof f; })()")); - executeJavaScriptAndGetResult(getWebContents(), "for (var i = 0; i < 2; ++i) gc();"); + + "var f = document.getElementById('frame1');" + + "f.parentNode.removeChild(f); return typeof f; })()")); + executeJavaScriptAndGetResult( + mActivityTestRule.getWebContents(), "for (var i = 0; i < 2; ++i) gc();"); Runtime.getRuntime().gc(); - assertNull(testObject.mWeakRefForInner.get()); + Assert.assertNull(testObject.mWeakRefForInner.get()); } private String executeJavaScriptAndGetResult(final WebContents webContents, @@ -262,7 +288,7 @@ } } final ResultCallback resultCallback = new ResultCallback(); - runTestOnUiThread(new Runnable() { + InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { webContents.evaluateJavaScriptForTests(script, resultCallback); @@ -277,7 +303,8 @@ */ private void loadDataSync(final NavigationController navigationController, final String data, final String mimeType, final boolean isBase64Encoded) throws Throwable { - loadUrl(navigationController, getTestCallBackHelperContainer(), + mActivityTestRule.loadUrl(navigationController, + mActivityTestRule.getTestCallBackHelperContainer(), LoadUrlParams.createLoadDataParams(data, mimeType, isBase64Encoded)); } }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java index fcccc896..a32d8e8 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java
@@ -39,7 +39,8 @@ private static final double ASSERTION_DELTA = 0; @Rule - public JavaBridgeActivityTestRule mActivityTestRule = new JavaBridgeActivityTestRule(); + public JavaBridgeActivityTestRule mActivityTestRule = + new JavaBridgeActivityTestRule().shouldSetUp(true); @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") private static class TestObject extends Controller {
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeFieldsTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeFieldsTest.java index 6f9a6de..b86f08d 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeFieldsTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeFieldsTest.java
@@ -24,7 +24,8 @@ @RunWith(BaseJUnit4ClassRunner.class) public class JavaBridgeFieldsTest { @Rule - public JavaBridgeActivityTestRule mActivityTestRule = new JavaBridgeActivityTestRule(); + public JavaBridgeActivityTestRule mActivityTestRule = + new JavaBridgeActivityTestRule().shouldSetUp(true); @SuppressFBWarnings({"CHROMIUM_SYNCHRONIZED_METHOD", "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"}) private static class TestObject extends Controller {
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeReturnValuesTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeReturnValuesTest.java index 904e4538..b243375 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeReturnValuesTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeReturnValuesTest.java
@@ -31,7 +31,8 @@ @RunWith(BaseJUnit4ClassRunner.class) public class JavaBridgeReturnValuesTest { @Rule - public JavaBridgeActivityTestRule mActivityTestRule = new JavaBridgeActivityTestRule(); + public JavaBridgeActivityTestRule mActivityTestRule = + new JavaBridgeActivityTestRule().shouldSetUp(true); // An instance of this class is injected into the page to test returning // Java values to JavaScript.
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/LocationProviderTest.java b/content/public/android/javatests/src/org/chromium/content/browser/LocationProviderTest.java index baed1013..c74b604 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/LocationProviderTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/LocationProviderTest.java
@@ -5,54 +5,68 @@ package org.chromium.content.browser; import android.app.Activity; +import android.support.test.InstrumentationRegistry; +import android.support.test.annotation.UiThreadTest; import android.support.test.filters.SmallTest; -import android.test.InstrumentationTestCase; -import android.test.UiThreadTest; +import android.support.test.rule.UiThreadTestRule; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.base.test.util.Feature; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.device.geolocation.LocationProviderAdapter; /** * Test suite for LocationProvider. */ -public class LocationProviderTest extends InstrumentationTestCase { +@RunWith(ContentJUnit4ClassRunner.class) +public class LocationProviderTest { private Activity mActivity; private LocationProviderAdapter mLocationProvider; + @Rule + public UiThreadTestRule mRule = new UiThreadTestRule(); + + @Before @SuppressFBWarnings("URF_UNREAD_FIELD") - @Override public void setUp() { mActivity = new Activity(); - mLocationProvider = - LocationProviderAdapter.create(getInstrumentation().getTargetContext()); + mLocationProvider = LocationProviderAdapter.create( + InstrumentationRegistry.getInstrumentation().getTargetContext()); } /** * Verify a normal start/stop call pair without any activity pauses. */ + @Test @SmallTest @UiThreadTest @Feature({"Location"}) public void testStartStop() throws Exception { mLocationProvider.start(false); - assertTrue("Should be running", mLocationProvider.isRunning()); + Assert.assertTrue("Should be running", mLocationProvider.isRunning()); mLocationProvider.stop(); - assertFalse("Should have stopped", mLocationProvider.isRunning()); + Assert.assertFalse("Should have stopped", mLocationProvider.isRunning()); } /** * Verify a start/upgrade/stop call sequence without any activity pauses. */ + @Test @SmallTest @UiThreadTest @Feature({"Location"}) public void testStartUpgradeStop() throws Exception { mLocationProvider.start(false); - assertTrue("Should be running", mLocationProvider.isRunning()); + Assert.assertTrue("Should be running", mLocationProvider.isRunning()); mLocationProvider.start(true); - assertTrue("Should be running", mLocationProvider.isRunning()); + Assert.assertTrue("Should be running", mLocationProvider.isRunning()); mLocationProvider.stop(); - assertFalse("Should have stopped", mLocationProvider.isRunning()); + Assert.assertFalse("Should have stopped", mLocationProvider.isRunning()); } }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java index 43f443b..885a560 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java
@@ -9,20 +9,32 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.os.SystemClock; +import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; import android.view.MotionEvent; import android.view.View; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.Feature; import org.chromium.content.browser.input.ImeAdapter; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; -import org.chromium.content_shell_apk.ContentShellTestBase; +import org.chromium.content_shell_apk.ContentShellActivityTestRule; /** * Tests for PopupZoomer. */ -public class PopupZoomerTest extends ContentShellTestBase { +@RunWith(ContentJUnit4ClassRunner.class) +public class PopupZoomerTest { + @Rule + public ContentShellActivityTestRule mActivityTestRule = new ContentShellActivityTestRule(); + private CustomCanvasPopupZoomer mPopupZoomer; private ContentViewCore mContentViewCore; @@ -75,45 +87,46 @@ MotionEvent.obtain(downEvent, downEvent + 10, MotionEvent.ACTION_UP, x, y, 0)); } - @Override - public void setUp() throws Exception { - super.setUp(); - - final Context context = getActivity(); - + @Before + public void setUp() throws Throwable { + mActivityTestRule.launchActivity(null); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { + Context context = mActivityTestRule.getActivity(); mContentViewCore = new ContentViewCore(context, ""); mContentViewCore.setSelectionPopupControllerForTesting(new SelectionPopupController( context, null, null, null, mContentViewCore.getRenderCoordinates())); mContentViewCore.setImeAdapterForTest( - new ImeAdapter(getContentViewCore().getWebContents(), - getContentViewCore().getContainerView(), + new ImeAdapter(mActivityTestRule.getContentViewCore().getWebContents(), + mActivityTestRule.getContentViewCore().getContainerView(), new TestInputMethodManagerWrapper(mContentViewCore))); - mPopupZoomer = createPopupZoomerForTest(getInstrumentation().getTargetContext()); + mPopupZoomer = createPopupZoomerForTest(InstrumentationRegistry.getTargetContext()); mContentViewCore.setPopupZoomerForTest(mPopupZoomer); } }); } + @Test @SmallTest @Feature({"Navigation"}) public void testDefaultCreateState() throws Exception { - assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); - assertFalse(mPopupZoomer.isShowing()); + Assert.assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); + Assert.assertFalse(mPopupZoomer.isShowing()); } + @Test @SmallTest @Feature({"Navigation"}) public void testShowWithoutBitmap() throws Exception { mPopupZoomer.show(new Rect(0, 0, 5, 5)); // The view should be invisible. - assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); - assertFalse(mPopupZoomer.isShowing()); + Assert.assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); + Assert.assertFalse(mPopupZoomer.isShowing()); } + @Test @SmallTest @Feature({"Navigation"}) public void testShowWithBitmap() throws Exception { @@ -121,10 +134,11 @@ mPopupZoomer.show(new Rect(0, 0, 5, 5)); // The view should become visible. - assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); - assertTrue(mPopupZoomer.isShowing()); + Assert.assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); + Assert.assertTrue(mPopupZoomer.isShowing()); } + @Test @SmallTest @Feature({"Navigation"}) public void testHide() throws Exception { @@ -132,17 +146,18 @@ mPopupZoomer.show(new Rect(0, 0, 5, 5)); // The view should become visible. - assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); - assertTrue(mPopupZoomer.isShowing()); + Assert.assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); + Assert.assertTrue(mPopupZoomer.isShowing()); // Call hide without animation. mPopupZoomer.hide(false); // The view should be invisible. - assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); - assertFalse(mPopupZoomer.isShowing()); + Assert.assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); + Assert.assertFalse(mPopupZoomer.isShowing()); } + @Test @SmallTest @Feature({"Navigation"}) public void testOnTouchEventOutsidePopup() throws Exception { @@ -153,8 +168,8 @@ mPopupZoomer.finishPendingDraws(); // The view should be visible. - assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); - assertTrue(mPopupZoomer.isShowing()); + Assert.assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); + Assert.assertTrue(mPopupZoomer.isShowing()); // Send tap event at a point outside the popup. // i.e. coordinates greater than 10 + PopupZoomer.ZOOM_BOUNDS_MARGIN @@ -164,10 +179,11 @@ mPopupZoomer.finishPendingDraws(); // The view should be invisible. - assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); - assertFalse(mPopupZoomer.isShowing()); + Assert.assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); + Assert.assertFalse(mPopupZoomer.isShowing()); } + @Test @SmallTest @Feature({"Navigation"}) public void testOnTouchEventInsidePopupNoOnTapListener() throws Exception { @@ -178,8 +194,8 @@ mPopupZoomer.finishPendingDraws(); // The view should be visible. - assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); - assertTrue(mPopupZoomer.isShowing()); + Assert.assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); + Assert.assertTrue(mPopupZoomer.isShowing()); // Send tap event at a point inside the popup. // i.e. coordinates between PopupZoomer.ZOOM_BOUNDS_MARGIN and @@ -190,10 +206,11 @@ mPopupZoomer.finishPendingDraws(); // The view should still be visible as no OnTapListener is set. - assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); - assertTrue(mPopupZoomer.isShowing()); + Assert.assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); + Assert.assertTrue(mPopupZoomer.isShowing()); } + @Test @SmallTest @Feature({"Navigation"}) public void testHidePopupOnLosingFocus() throws Exception { @@ -205,8 +222,8 @@ mPopupZoomer.finishPendingDraws(); // The view should be visible. - assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); - assertTrue(mPopupZoomer.isShowing()); + Assert.assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); + Assert.assertTrue(mPopupZoomer.isShowing()); // Simulate losing the focus. mContentViewCore.onFocusChanged(false, true); @@ -215,7 +232,7 @@ mPopupZoomer.finishPendingDraws(); // Now that another view has been focused, the view should be invisible. - assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); - assertFalse(mPopupZoomer.isShowing()); + Assert.assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); + Assert.assertFalse(mPopupZoomer.isShowing()); } }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/VideoFullscreenOrientationLockTest.java b/content/public/android/javatests/src/org/chromium/content/browser/VideoFullscreenOrientationLockTest.java index 133fc31..4ba5c820 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/VideoFullscreenOrientationLockTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/VideoFullscreenOrientationLockTest.java
@@ -6,17 +6,25 @@ import android.content.pm.ActivityInfo; import android.graphics.Rect; +import android.support.test.InstrumentationRegistry; import android.support.test.filters.MediumTest; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.DOMUtils; import org.chromium.content.browser.test.util.JavaScriptUtils; import org.chromium.content.browser.test.util.UiUtils; import org.chromium.content.common.ContentSwitches; -import org.chromium.content_shell_apk.ContentShellTestBase; +import org.chromium.content_shell_apk.ContentShellActivityTestRule; import org.chromium.ui.base.DeviceFormFactor; import java.util.concurrent.Callable; @@ -25,27 +33,31 @@ /** * Integration tests for the feature that auto locks the orientation when a video goes fullscreen. * See also chrome layer org.chromium.chrome.browser.VideoFullscreenOrientationLockChromeTest - */ -@CommandLineFlags.Add({ "enable-features=VideoFullscreenOrientationLock", - ContentSwitches.DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK }) -public class VideoFullscreenOrientationLockTest extends ContentShellTestBase { +ContentSwitches.ENABLE_TEST_INTENTS */ +@RunWith(ContentJUnit4ClassRunner.class) +@CommandLineFlags.Add({"enable-features=VideoFullscreenOrientationLock", + ContentSwitches.DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK, + ContentSwitches.ENABLE_TEST_INTENTS}) +public class VideoFullscreenOrientationLockTest { + @Rule + public ContentShellActivityTestRule mActivityTestRule = new ContentShellActivityTestRule(); + private static final String TEST_URL = "content/test/data/media/video-player.html"; private static final String VIDEO_ID = "video"; - private void waitForContentsFullscreenState(boolean fullscreenValue) - throws InterruptedException { + private void waitForContentsFullscreenState(boolean fullscreenValue) { CriteriaHelper.pollInstrumentationThread( Criteria.equals(fullscreenValue, new Callable<Boolean>() { @Override public Boolean call() throws InterruptedException, TimeoutException { - return DOMUtils.isFullscreen(getWebContents()); + return DOMUtils.isFullscreen(mActivityTestRule.getWebContents()); } }) ); } private boolean isScreenOrientationLocked() { - return getActivity().getRequestedOrientation() + return mActivityTestRule.getActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; } @@ -55,7 +67,9 @@ sb.append(" return screen.orientation.type.startsWith('landscape');"); sb.append("})();"); - return JavaScriptUtils.executeJavaScriptAndWaitForResult(getWebContents(), sb.toString()) + return JavaScriptUtils + .executeJavaScriptAndWaitForResult( + mActivityTestRule.getWebContents(), sb.toString()) .equals("true"); } @@ -107,29 +121,31 @@ } private boolean clickFullscreenButton() throws InterruptedException, TimeoutException { - return DOMUtils.clickRect(getContentViewCore(), - fullscreenButtonBounds(DOMUtils.getNodeBounds(getWebContents(), VIDEO_ID))); + return DOMUtils.clickRect(mActivityTestRule.getContentViewCore(), + fullscreenButtonBounds( + DOMUtils.getNodeBounds(mActivityTestRule.getWebContents(), VIDEO_ID))); } - @Override + @Before public void setUp() throws Exception { - super.setUp(); - - startActivityWithTestUrl(TEST_URL); + mActivityTestRule.launchContentShellWithUrlSync(TEST_URL); } + @Test @MediumTest @Feature({"VideoFullscreenOrientationLock"}) public void testEnterExitFullscreenWithControlsButton() throws Exception { - if (DeviceFormFactor.isTablet(getInstrumentation().getContext())) return; + if (DeviceFormFactor.isTablet(InstrumentationRegistry.getInstrumentation().getContext())) { + return; + } // Start playback to guarantee it's properly loaded. - assertTrue(DOMUtils.isMediaPaused(getWebContents(), VIDEO_ID)); - DOMUtils.playMedia(getWebContents(), VIDEO_ID); - DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID); + Assert.assertTrue(DOMUtils.isMediaPaused(mActivityTestRule.getWebContents(), VIDEO_ID)); + DOMUtils.playMedia(mActivityTestRule.getWebContents(), VIDEO_ID); + DOMUtils.waitForMediaPlay(mActivityTestRule.getWebContents(), VIDEO_ID); // Simulate click on fullscreen button. - assertTrue(clickFullscreenButton()); + Assert.assertTrue(clickFullscreenButton()); waitForContentsFullscreenState(true); // Should be locked to landscape now, `waitUntilLockedToLandscape` will throw otherwise. @@ -137,49 +153,55 @@ // Because of the fullscreen animation, the click on the exit fullscreen button will fail // roughly 10% of the time. Settling down the UI reduces the flake to 0%. - UiUtils.settleDownUI(getInstrumentation()); + UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); // Leave fullscreen by clicking back on the button. - assertTrue(clickFullscreenButton()); + Assert.assertTrue(clickFullscreenButton()); waitForContentsFullscreenState(false); waitUntilUnlocked(); } + @Test @MediumTest @Feature({"VideoFullscreenOrientationLock"}) public void testEnterExitFullscreenWithAPI() throws Exception { - if (DeviceFormFactor.isTablet(getInstrumentation().getContext())) return; + if (DeviceFormFactor.isTablet(InstrumentationRegistry.getInstrumentation().getContext())) { + return; + } // Start playback to guarantee it's properly loaded. - assertTrue(DOMUtils.isMediaPaused(getWebContents(), VIDEO_ID)); - DOMUtils.playMedia(getWebContents(), VIDEO_ID); - DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID); + Assert.assertTrue(DOMUtils.isMediaPaused(mActivityTestRule.getWebContents(), VIDEO_ID)); + DOMUtils.playMedia(mActivityTestRule.getWebContents(), VIDEO_ID); + DOMUtils.waitForMediaPlay(mActivityTestRule.getWebContents(), VIDEO_ID); // Trigger requestFullscreen() via a click on a button. - assertTrue(DOMUtils.clickNode(getContentViewCore(), "fullscreen")); + Assert.assertTrue(DOMUtils.clickNode(mActivityTestRule.getContentViewCore(), "fullscreen")); waitForContentsFullscreenState(true); // Should be locked to landscape now, `waitUntilLockedToLandscape` will throw otherwise. waitUntilLockedToLandscape(); // Leave fullscreen from API. - DOMUtils.exitFullscreen(getWebContents()); + DOMUtils.exitFullscreen(mActivityTestRule.getWebContents()); waitForContentsFullscreenState(false); waitUntilUnlocked(); } + @Test @MediumTest @Feature({"VideoFullscreenOrientationLock"}) public void testExitFullscreenByRemovingVideo() throws Exception { - if (DeviceFormFactor.isTablet(getInstrumentation().getContext())) return; + if (DeviceFormFactor.isTablet(InstrumentationRegistry.getInstrumentation().getContext())) { + return; + } // Start playback to guarantee it's properly loaded. - assertTrue(DOMUtils.isMediaPaused(getWebContents(), VIDEO_ID)); - DOMUtils.playMedia(getWebContents(), VIDEO_ID); - DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID); + Assert.assertTrue(DOMUtils.isMediaPaused(mActivityTestRule.getWebContents(), VIDEO_ID)); + DOMUtils.playMedia(mActivityTestRule.getWebContents(), VIDEO_ID); + DOMUtils.waitForMediaPlay(mActivityTestRule.getWebContents(), VIDEO_ID); // Trigger requestFullscreen() via a click on a button. - assertTrue(DOMUtils.clickNode(getContentViewCore(), "fullscreen")); + Assert.assertTrue(DOMUtils.clickNode(mActivityTestRule.getContentViewCore(), "fullscreen")); waitForContentsFullscreenState(true); // Should be locked to landscape now, `waitUntilLockedToLandscape` will throw otherwise. @@ -187,30 +209,34 @@ // Leave fullscreen by removing video element from page. JavaScriptUtils.executeJavaScriptAndWaitForResult( - getWebContents(), "document.body.innerHTML = '';"); + mActivityTestRule.getWebContents(), "document.body.innerHTML = '';"); waitForContentsFullscreenState(false); waitUntilUnlocked(); } + @Test @MediumTest @Feature({"VideoFullscreenOrientationLock"}) public void testExitFullscreenWithNavigation() throws Exception { - if (DeviceFormFactor.isTablet(getInstrumentation().getContext())) return; + if (DeviceFormFactor.isTablet(InstrumentationRegistry.getInstrumentation().getContext())) { + return; + } // Start playback to guarantee it's properly loaded. - assertTrue(DOMUtils.isMediaPaused(getWebContents(), VIDEO_ID)); - DOMUtils.playMedia(getWebContents(), VIDEO_ID); - DOMUtils.waitForMediaPlay(getWebContents(), VIDEO_ID); + Assert.assertTrue(DOMUtils.isMediaPaused(mActivityTestRule.getWebContents(), VIDEO_ID)); + DOMUtils.playMedia(mActivityTestRule.getWebContents(), VIDEO_ID); + DOMUtils.waitForMediaPlay(mActivityTestRule.getWebContents(), VIDEO_ID); // Trigger requestFullscreen() via a click on a button. - assertTrue(DOMUtils.clickNode(getContentViewCore(), "fullscreen")); + Assert.assertTrue(DOMUtils.clickNode(mActivityTestRule.getContentViewCore(), "fullscreen")); waitForContentsFullscreenState(true); // Should be locked to landscape now, `waitUntilLockedToLandscape` will throw otherwise. waitUntilLockedToLandscape(); // Leave fullscreen by navigating page. - JavaScriptUtils.executeJavaScriptAndWaitForResult(getWebContents(), "location.reload();"); + JavaScriptUtils.executeJavaScriptAndWaitForResult( + mActivityTestRule.getWebContents(), "location.reload();"); waitForContentsFullscreenState(false); waitUntilUnlocked(); }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java index bf6a11d..756e8b5 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java
@@ -9,22 +9,27 @@ import android.graphics.RectF; import android.os.Build; import android.support.test.filters.SmallTest; -import android.test.InstrumentationTestCase; import android.text.TextUtils; import android.view.View; import android.view.inputmethod.CursorAnchorInfo; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.content.browser.RenderCoordinates; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; /** * Test for {@link CursorAnchorInfoController}. */ +@RunWith(ContentJUnit4ClassRunner.class) @MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP) @TargetApi(Build.VERSION_CODES.LOLLIPOP) -public class CursorAnchorInfoControllerTest extends InstrumentationTestCase { +public class CursorAnchorInfoControllerTest { private static RenderCoordinates createRenderCoordinates(float deviceScaleFactor, float contentOffsetYPix) { RenderCoordinates renderCoordinates = new RenderCoordinates(); @@ -87,44 +92,47 @@ } } - private void assertScaleAndTranslate(float expectedScale, float expectedTranslateX, - float expectedTranslateY, CursorAnchorInfo actual) { - Matrix expectedMatrix = new Matrix(); - expectedMatrix.setScale(expectedScale, expectedScale); - expectedMatrix.postTranslate(expectedTranslateX, expectedTranslateY); - assertEquals(expectedMatrix, actual.getMatrix()); + private static class AssertionHelper { + static void assertScaleAndTranslate(float expectedScale, float expectedTranslateX, + float expectedTranslateY, CursorAnchorInfo actual) { + Matrix expectedMatrix = new Matrix(); + expectedMatrix.setScale(expectedScale, expectedScale); + expectedMatrix.postTranslate(expectedTranslateX, expectedTranslateY); + Assert.assertEquals(expectedMatrix, actual.getMatrix()); + } + + static void assertHasInsertionMarker(int expectedFlags, float expectedHorizontal, + float expectedTop, float expectedBaseline, float expectedBottom, + CursorAnchorInfo actual) { + Assert.assertEquals(expectedFlags, actual.getInsertionMarkerFlags()); + Assert.assertEquals(expectedHorizontal, actual.getInsertionMarkerHorizontal(), 0); + Assert.assertEquals(expectedTop, actual.getInsertionMarkerTop(), 0); + Assert.assertEquals(expectedBaseline, actual.getInsertionMarkerBaseline(), 0); + Assert.assertEquals(expectedBottom, actual.getInsertionMarkerBottom(), 0); + } + + static void assertHasNoInsertionMarker(CursorAnchorInfo actual) { + Assert.assertEquals(0, actual.getInsertionMarkerFlags()); + Assert.assertTrue(Float.isNaN(actual.getInsertionMarkerHorizontal())); + Assert.assertTrue(Float.isNaN(actual.getInsertionMarkerTop())); + Assert.assertTrue(Float.isNaN(actual.getInsertionMarkerBaseline())); + Assert.assertTrue(Float.isNaN(actual.getInsertionMarkerBottom())); + } + + static void assertComposingText(CharSequence expectedComposingText, + int expectedComposingTextStart, CursorAnchorInfo actual) { + Assert.assertTrue(TextUtils.equals(expectedComposingText, actual.getComposingText())); + Assert.assertEquals(expectedComposingTextStart, actual.getComposingTextStart()); + } + + static void assertSelection( + int expecteSelectionStart, int expecteSelectionEnd, CursorAnchorInfo actual) { + Assert.assertEquals(expecteSelectionStart, actual.getSelectionStart()); + Assert.assertEquals(expecteSelectionEnd, actual.getSelectionEnd()); + } } - private void assertHasInsertionMarker(int expectedFlags, float expectedHorizontal, - float expectedTop, float expectedBaseline, float expectedBottom, - CursorAnchorInfo actual) { - assertEquals(expectedFlags, actual.getInsertionMarkerFlags()); - assertEquals(expectedHorizontal, actual.getInsertionMarkerHorizontal()); - assertEquals(expectedTop, actual.getInsertionMarkerTop()); - assertEquals(expectedBaseline, actual.getInsertionMarkerBaseline()); - assertEquals(expectedBottom, actual.getInsertionMarkerBottom()); - } - - private void assertHasNoInsertionMarker(CursorAnchorInfo actual) { - assertEquals(0, actual.getInsertionMarkerFlags()); - assertTrue(Float.isNaN(actual.getInsertionMarkerHorizontal())); - assertTrue(Float.isNaN(actual.getInsertionMarkerTop())); - assertTrue(Float.isNaN(actual.getInsertionMarkerBaseline())); - assertTrue(Float.isNaN(actual.getInsertionMarkerBottom())); - } - - private void assertComposingText(CharSequence expectedComposingText, - int expectedComposingTextStart, CursorAnchorInfo actual) { - assertTrue(TextUtils.equals(expectedComposingText, actual.getComposingText())); - assertEquals(expectedComposingTextStart, actual.getComposingTextStart()); - } - - private void assertSelection(int expecteSelectionStart, int expecteSelectionEnd, - CursorAnchorInfo actual) { - assertEquals(expecteSelectionStart, actual.getSelectionStart()); - assertEquals(expecteSelectionEnd, actual.getSelectionEnd()); - } - + @Test @SmallTest @Feature({"Input-Text-IME"}) public void testFocusedNodeChanged() { @@ -138,7 +146,7 @@ viewDelegate.locationX = 0; viewDelegate.locationY = 0; - assertFalse( + Assert.assertFalse( "IC#onRequestCursorUpdates() must be rejected if the focused node is not editable.", controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); @@ -148,7 +156,7 @@ composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); controller.focusedNodeChanged(false); composingTextDelegate.clearTextAndSelection(controller); @@ -159,9 +167,10 @@ composingTextDelegate.updateTextAndSelection(controller, "1", 0, 1, 0, 1); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 100.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); } + @Test @SmallTest @Feature({"Input-Text-IME"}) public void testImmediateMode() { @@ -179,65 +188,65 @@ // Make sure that #updateCursorAnchorInfo() is not be called until the matrix info becomes // available with #onUpdateFrameInfo(). - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( true /* immediate request */, false /* monitor request */, view)); controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view); composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1); - assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that 2nd call of #onUpdateFrameInfo() is ignored. controller.onUpdateFrameInfo(createRenderCoordinates(2.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); // Make sure that #onUpdateFrameInfo() is immediately called because the matrix info is // already available. - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( true /* immediate request */, false /* monitor request */, view)); - assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), + Assert.assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that CURSOR_UPDATE_IMMEDIATE and CURSOR_UPDATE_MONITOR can be specified at // the same time. - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( true /* immediate request*/, true /* monitor request */, view)); - assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), + Assert.assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that CURSOR_UPDATE_IMMEDIATE is cleared if the focused node becomes @@ -245,32 +254,33 @@ controller.focusedNodeChanged(false); controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( true /* immediate request */, false /* monitor request */, view)); controller.focusedNodeChanged(false); composingTextDelegate.clearTextAndSelection(controller); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 100.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); // Make sure that CURSOR_UPDATE_IMMEDIATE can be enabled again. controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( true /* immediate request */, false /* monitor request */, view)); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText(null, -1, immw.getLastCursorAnchorInfo()); - assertSelection(-1, -1, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(0)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); + AssertionHelper.assertComposingText(null, -1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(-1, -1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); } + @Test @SmallTest @Feature({"Input-Text-IME"}) public void testMonitorMode() { @@ -288,23 +298,23 @@ // Make sure that #updateCursorAnchorInfo() is not be called until the matrix info becomes // available with #onUpdateFrameInfo(). - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view); composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1); - assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(0, immw.getUpdateCursorAnchorInfoCounter()); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that #updateCursorAnchorInfo() is not be called if any coordinate parameter is @@ -312,58 +322,58 @@ controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); // Make sure that #updateCursorAnchorInfo() is called if #setCompositionCharacterBounds() // is called with a different parameter. controller.setCompositionCharacterBounds(new float[] {30.0f, 1.0f, 32.0f, 3.0f}, view); - assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), + Assert.assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that #updateCursorAnchorInfo() is called if #updateTextAndSelection() // is called with a different parameter. composingTextDelegate.updateTextAndSelection(controller, "1", 0, 1, 0, 1); - assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), + Assert.assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("1", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("1", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that #updateCursorAnchorInfo() is called if #onUpdateFrameInfo() // is called with a different parameter. controller.onUpdateFrameInfo(createRenderCoordinates(2.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), + Assert.assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("1", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("1", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that #updateCursorAnchorInfo() is called when the view origin is changed. @@ -371,16 +381,16 @@ viewDelegate.locationY = 9; controller.onUpdateFrameInfo(createRenderCoordinates(2.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(2.0f, 7.0f, 9.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), + Assert.assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(2.0f, 7.0f, 9.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(30.0f, 1.0f, 32.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("1", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("1", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Make sure that CURSOR_UPDATE_IMMEDIATE is cleared if the focused node becomes @@ -388,7 +398,7 @@ controller.focusedNodeChanged(false); controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); controller.focusedNodeChanged(false); composingTextDelegate.clearTextAndSelection(controller); @@ -396,33 +406,34 @@ composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); // Make sure that CURSOR_UPDATE_MONITOR can be enabled again. controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view); composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1); - assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(5, immw.getUpdateCursorAnchorInfoCounter()); viewDelegate.locationX = 0; viewDelegate.locationY = 0; controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 2.0f, 0.0f, 3.0f, view); - assertEquals(6, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, 0.0f, 3.0f, - 3.0f, immw.getLastCursorAnchorInfo()); - assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), + Assert.assertEquals(6, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 2.0f, + 0.0f, 3.0f, 3.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); - assertSelection(0, 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertComposingText("0", 0, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(0, 1, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); } + @Test @SmallTest @Feature({"Input-Text-IME"}) public void testSetCompositionCharacterBounds() { @@ -438,7 +449,7 @@ controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); composingTextDelegate.updateTextAndSelection(controller, "01234", 1, 3, 1, 1); @@ -446,23 +457,24 @@ 4.0f, 1.1f, 6.0f, 2.9f}, view); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), false, false, Float.NaN, Float.NaN, Float.NaN, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(0)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); + Assert.assertEquals(new RectF(0.0f, 1.0f, 2.0f, 3.0f), immw.getLastCursorAnchorInfo().getCharacterBounds(1)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(1)); - assertEquals(new RectF(4.0f, 1.1f, 6.0f, 2.9f), + Assert.assertEquals(new RectF(4.0f, 1.1f, 6.0f, 2.9f), immw.getLastCursorAnchorInfo().getCharacterBounds(2)); - assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, + Assert.assertEquals(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(2)); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(3)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(3)); - assertComposingText("12", 1, immw.getLastCursorAnchorInfo()); - assertSelection(1, 1, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(3)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(3)); + AssertionHelper.assertComposingText("12", 1, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(1, 1, immw.getLastCursorAnchorInfo()); } + @Test @SmallTest @Feature({"Input-Text-IME"}) public void testUpdateTextAndSelection() { @@ -478,27 +490,28 @@ controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); composingTextDelegate.updateTextAndSelection(controller, "01234", 3, 3, 1, 1); controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), false, false, Float.NaN, Float.NaN, Float.NaN, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(0)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(1)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(1)); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(2)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(2)); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(3)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(3)); - assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(4)); - assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(4)); - assertComposingText("", 3, immw.getLastCursorAnchorInfo()); - assertSelection(1, 1, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(0)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(0)); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(1)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(1)); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(2)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(2)); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(3)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(3)); + Assert.assertEquals(null, immw.getLastCursorAnchorInfo().getCharacterBounds(4)); + Assert.assertEquals(0, immw.getLastCursorAnchorInfo().getCharacterBoundsFlags(4)); + AssertionHelper.assertComposingText("", 3, immw.getLastCursorAnchorInfo()); + AssertionHelper.assertSelection(1, 1, immw.getLastCursorAnchorInfo()); } + @Test @SmallTest @Feature({"Input-Text-IME"}) public void testInsertionMarker() { @@ -511,33 +524,34 @@ controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); // Test no insertion marker. controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), false, false, Float.NaN, Float.NaN, Float.NaN, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); - assertHasNoInsertionMarker(immw.getLastCursorAnchorInfo()); + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertHasNoInsertionMarker(immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Test a visible insertion marker. controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, true, 10.0f, 23.0f, 29.0f, view); - assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, - 10.0f, 23.0f, 29.0f, 29.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION, 10.0f, + 23.0f, 29.0f, 29.0f, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // Test a invisible insertion marker. controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), true, false, 10.0f, 23.0f, 29.0f, view); - assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); - assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION, - 10.0f, 23.0f, 29.0f, 29.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertHasInsertionMarker(CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION, 10.0f, + 23.0f, 29.0f, 29.0f, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); } + @Test @SmallTest @Feature({"Input-Text-IME"}) public void testMatrix() { @@ -550,7 +564,7 @@ controller.focusedNodeChanged(true); composingTextDelegate.clearTextAndSelection(controller); - assertTrue(controller.onRequestCursorUpdates( + Assert.assertTrue(controller.onRequestCursorUpdates( false /* immediate request */, true /* monitor request */, view)); // Test no transformation @@ -558,8 +572,8 @@ viewDelegate.locationY = 0; controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f), false, false, Float.NaN, Float.NaN, Float.NaN, view); - assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(1, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(1.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // device scale factor == 2.0 @@ -567,8 +581,8 @@ viewDelegate.locationY = 0; controller.onUpdateFrameInfo(createRenderCoordinates(2.0f, 0.0f), false, false, Float.NaN, Float.NaN, Float.NaN, view); - assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(2, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate(2.0f, 0.0f, 0.0f, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // device scale factor == 2.0 @@ -577,8 +591,9 @@ viewDelegate.locationY = 141; controller.onUpdateFrameInfo(createRenderCoordinates(2.0f, 0.0f), false, false, Float.NaN, Float.NaN, Float.NaN, view); - assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(2.0f, 10.0f, 141.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(3, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate( + 2.0f, 10.0f, 141.0f, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); // device scale factor == 2.0 @@ -588,8 +603,9 @@ viewDelegate.locationY = 141; controller.onUpdateFrameInfo(createRenderCoordinates(2.0f, 40.0f), false, false, Float.NaN, Float.NaN, Float.NaN, view); - assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); - assertScaleAndTranslate(2.0f, 10.0f, 181.0f, immw.getLastCursorAnchorInfo()); + Assert.assertEquals(4, immw.getUpdateCursorAnchorInfoCounter()); + AssertionHelper.assertScaleAndTranslate( + 2.0f, 10.0f, 181.0f, immw.getLastCursorAnchorInfo()); immw.clearLastCursorAnchorInfo(); } }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java new file mode 100644 index 0000000..8ec3f26a --- /dev/null +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java
@@ -0,0 +1,616 @@ +// Copyright 2017 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. + +package org.chromium.content.browser.input; + +import android.annotation.TargetApi; +import android.app.Activity; +import android.content.ClipData; +import android.content.ClipboardManager; +import android.content.Context; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Pair; +import android.view.KeyEvent; +import android.view.View; +import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputConnection; + +import org.junit.Assert; + +import org.chromium.base.ThreadUtils; +import org.chromium.content.browser.ContentViewCore; +import org.chromium.content.browser.SelectionPopupController; +import org.chromium.content.browser.test.util.Criteria; +import org.chromium.content.browser.test.util.CriteriaHelper; +import org.chromium.content.browser.test.util.DOMUtils; +import org.chromium.content.browser.test.util.JavaScriptUtils; +import org.chromium.content.browser.test.util.TestCallbackHelperContainer; +import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; +import org.chromium.content_public.browser.WebContents; +import org.chromium.content_shell_apk.ContentShellActivityTestRule; +import org.chromium.ui.base.ime.TextInputType; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +/** + * Integration tests for text input for Android L (or above) features. + */ +class ImeActivityTestRule extends ContentShellActivityTestRule { + private ChromiumBaseInputConnection mConnection; + private TestInputConnectionFactory mConnectionFactory; + private ImeAdapter mImeAdapter; + + static final String INPUT_FORM_HTML = "content/test/data/android/input/input_forms.html"; + + private ContentViewCore mContentViewCore; + private SelectionPopupController mSelectionPopupController; + private TestCallbackHelperContainer mCallbackContainer; + private TestInputMethodManagerWrapper mInputMethodManagerWrapper; + + public void setUp() throws Exception { + launchContentShellWithUrlSync(INPUT_FORM_HTML); + mContentViewCore = getContentViewCore(); + mSelectionPopupController = mContentViewCore.getSelectionPopupControllerForTesting(); + mInputMethodManagerWrapper = new TestInputMethodManagerWrapper(mContentViewCore) { + private boolean mExpectsSelectionOutsideComposition; + + @Override + public void expectsSelectionOutsideComposition() { + mExpectsSelectionOutsideComposition = true; + } + + @Override + public void onUpdateSelection( + Range oldSel, Range oldComp, Range newSel, Range newComp) { + // We expect that selection will be outside composition in some cases. Keyboard + // app will not finish composition in this case. + if (mExpectsSelectionOutsideComposition) { + mExpectsSelectionOutsideComposition = false; + return; + } + if (oldComp == null || oldComp.start() == oldComp.end() + || newComp.start() == newComp.end()) { + return; + } + // This emulates keyboard app's behavior that finishes composition when + // selection is outside composition. + if (!newSel.intersects(newComp)) { + try { + finishComposingText(); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + } + }; + getImeAdapter().setInputMethodManagerWrapperForTest(mInputMethodManagerWrapper); + Assert.assertEquals(0, mInputMethodManagerWrapper.getShowSoftInputCounter()); + mConnectionFactory = + new TestInputConnectionFactory(getImeAdapter().getInputConnectionFactoryForTest()); + getImeAdapter().setInputConnectionFactory(mConnectionFactory); + + mCallbackContainer = new TestCallbackHelperContainer(mContentViewCore); + DOMUtils.waitForNonZeroNodeBounds(getWebContents(), "input_text"); + boolean result = DOMUtils.clickNode(mContentViewCore, "input_text"); + + Assert.assertEquals("Failed to dispatch touch event.", true, result); + assertWaitForKeyboardStatus(true); + + mConnection = getInputConnection(); + mImeAdapter = getImeAdapter(); + + waitForKeyboardStates(1, 0, 1, new Integer[] {TextInputType.TEXT}); + Assert.assertEquals(0, mConnectionFactory.getOutAttrs().initialSelStart); + Assert.assertEquals(0, mConnectionFactory.getOutAttrs().initialSelEnd); + + waitForEventLogs("selectionchange"); + clearEventLogs(); + + waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); + resetAllStates(); + } + + SelectionPopupController getSelectionPopupController() { + return mSelectionPopupController; + } + + TestCallbackHelperContainer getTestCallBackHelperContainer() { + return mCallbackContainer; + } + + ChromiumBaseInputConnection getConnection() { + return mConnection; + } + + TestInputMethodManagerWrapper getInputMethodManagerWrapper() { + return mInputMethodManagerWrapper; + } + + TestInputConnectionFactory getConnectionFactory() { + return mConnectionFactory; + } + + void fullyLoadUrl(final String url) throws Throwable { + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + getActivity().getActiveShell().loadUrl(url); + } + }); + waitForActiveShellToBeDoneLoading(); + } + + void clearEventLogs() throws Exception { + final String code = "clearEventLogs()"; + JavaScriptUtils.executeJavaScriptAndWaitForResult( + getContentViewCore().getWebContents(), code); + } + + void waitForEventLogs(String expectedLogs) throws Exception { + final String code = "getEventLogs()"; + final String sanitizedExpectedLogs = "\"" + expectedLogs + "\""; + Assert.assertEquals(sanitizedExpectedLogs, + JavaScriptUtils.executeJavaScriptAndWaitForResult( + getContentViewCore().getWebContents(), code)); + } + + void assertTextsAroundCursor(CharSequence before, CharSequence selected, CharSequence after) + throws Exception { + Assert.assertEquals(before, getTextBeforeCursor(100, 0)); + Assert.assertEquals(selected, getSelectedText(0)); + Assert.assertEquals(after, getTextAfterCursor(100, 0)); + } + + void waitForKeyboardStates(int show, int hide, int restart, Integer[] history) { + final String expected = stringifyKeyboardStates(show, hide, restart, history); + CriteriaHelper.pollUiThread(Criteria.equals(expected, new Callable<String>() { + @Override + public String call() { + return getKeyboardStates(); + } + })); + } + + void resetAllStates() { + mInputMethodManagerWrapper.reset(); + mConnectionFactory.clearTextInputTypeHistory(); + } + + String getKeyboardStates() { + int showCount = mInputMethodManagerWrapper.getShowSoftInputCounter(); + int hideCount = mInputMethodManagerWrapper.getHideSoftInputCounter(); + int restartCount = mInputMethodManagerWrapper.getRestartInputCounter(); + Integer[] history = mConnectionFactory.getTextInputTypeHistory(); + return stringifyKeyboardStates(showCount, hideCount, restartCount, history); + } + + String stringifyKeyboardStates(int show, int hide, int restart, Integer[] history) { + return "show count: " + show + ", hide count: " + hide + ", restart count: " + restart + + ", input type history: " + Arrays.deepToString(history); + } + + void performGo(TestCallbackHelperContainer testCallbackHelperContainer) throws Throwable { + final InputConnection inputConnection = mConnection; + final Callable<Void> callable = new Callable<Void>() { + @Override + public Void call() throws Exception { + inputConnection.performEditorAction(EditorInfo.IME_ACTION_GO); + return null; + } + }; + + handleBlockingCallbackAction( + testCallbackHelperContainer.getOnPageFinishedHelper(), new Runnable() { + @Override + public void run() { + try { + runBlockingOnImeThread(callable); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + }); + } + + void assertWaitForKeyboardStatus(final boolean show) { + CriteriaHelper.pollUiThread(new Criteria() { + @Override + public boolean isSatisfied() { + // We do not check the other way around: in some cases we need to keep + // input connection even when the last known status is 'hidden'. + if (show && getInputConnection() == null) { + updateFailureReason("input connection should not be null."); + return false; + } + updateFailureReason("expected show: " + show); + return show == mInputMethodManagerWrapper.isShowWithoutHideOutstanding(); + } + }); + } + + void assertWaitForSelectActionBarStatus(final boolean show) { + CriteriaHelper.pollUiThread(Criteria.equals(show, new Callable<Boolean>() { + @Override + public Boolean call() { + return mContentViewCore.isSelectActionBarShowing(); + } + })); + } + + void waitAndVerifyUpdateSelection(final int index, final int selectionStart, + final int selectionEnd, final int compositionStart, final int compositionEnd) { + final List<Pair<Range, Range>> states = mInputMethodManagerWrapper.getUpdateSelectionList(); + CriteriaHelper.pollUiThread(new Criteria() { + @Override + public boolean isSatisfied() { + return states.size() > index; + } + }); + Pair<Range, Range> selection = states.get(index); + Assert.assertEquals(selectionStart, selection.first.start()); + Assert.assertEquals(selectionEnd, selection.first.end()); + Assert.assertEquals(compositionStart, selection.second.start()); + Assert.assertEquals(compositionEnd, selection.second.end()); + } + + void resetUpdateSelectionList() { + mInputMethodManagerWrapper.getUpdateSelectionList().clear(); + } + + void assertClipboardContents(final Activity activity, final String expectedContents) { + CriteriaHelper.pollUiThread(new Criteria() { + @Override + public boolean isSatisfied() { + ClipboardManager clipboardManager = + (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); + ClipData clip = clipboardManager.getPrimaryClip(); + return clip != null && clip.getItemCount() == 1 + && TextUtils.equals(clip.getItemAt(0).getText(), expectedContents); + } + }); + } + + ImeAdapter getImeAdapter() { + return mContentViewCore.getImeAdapterForTest(); + } + + ChromiumBaseInputConnection getInputConnection() { + try { + return ThreadUtils.runOnUiThreadBlocking(new Callable<ChromiumBaseInputConnection>() { + @Override + public ChromiumBaseInputConnection call() { + return mContentViewCore.getImeAdapterForTest().getInputConnectionForTest(); + } + }); + } catch (ExecutionException e) { + e.printStackTrace(); + Assert.fail(); + return null; + } + } + + void restartInput() { + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + mImeAdapter.restartInput(); + } + }); + } + + // After calling this method, we should call assertClipboardContents() to wait for the clipboard + // to get updated. See cubug.com/621046 + void copy() { + final WebContents webContents = getWebContents(); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + webContents.copy(); + } + }); + } + + void cut() { + final WebContents webContents = getWebContents(); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + webContents.cut(); + } + }); + } + + void setClip(final CharSequence text) { + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + final ClipboardManager clipboardManager = + (ClipboardManager) getActivity().getSystemService( + Context.CLIPBOARD_SERVICE); + clipboardManager.setPrimaryClip(ClipData.newPlainText(null, text)); + } + }); + } + + void paste() { + final WebContents webContents = getWebContents(); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + webContents.paste(); + } + }); + } + + void selectAll() { + final WebContents webContents = getWebContents(); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + webContents.selectAll(); + } + }); + } + + void collapseSelection() { + final WebContents webContents = getWebContents(); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + webContents.collapseSelection(); + } + }); + } + + /** + * Run the {@Callable} on IME thread (or UI thread if not applicable). + * @param c The callable + * @return The result from running the callable. + */ + <T> T runBlockingOnImeThread(Callable<T> c) throws Exception { + return ImeTestUtils.runBlockingOnHandler(mConnectionFactory.getHandler(), c); + } + + boolean beginBatchEdit() throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.beginBatchEdit(); + } + }); + } + + boolean endBatchEdit() throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.endBatchEdit(); + } + }); + } + + boolean commitText(final CharSequence text, final int newCursorPosition) throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.commitText(text, newCursorPosition); + } + }); + } + + boolean setSelection(final int start, final int end) throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.setSelection(start, end); + } + }); + } + + boolean setComposingRegion(final int start, final int end) throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.setComposingRegion(start, end); + } + }); + } + + protected boolean setComposingText(final CharSequence text, final int newCursorPosition) + throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.setComposingText(text, newCursorPosition); + } + }); + } + + boolean finishComposingText() throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.finishComposingText(); + } + }); + } + + boolean deleteSurroundingText(final int before, final int after) throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.deleteSurroundingText(before, after); + } + }); + } + + // Note that deleteSurroundingTextInCodePoints() was introduced in Android N (Api level 24), but + // the Android repository used in Chrome is behind that (level 23). So this function can't be + // called by keyboard apps currently. + @TargetApi(24) + boolean deleteSurroundingTextInCodePoints(final int before, final int after) throws Exception { + final ThreadedInputConnection connection = (ThreadedInputConnection) mConnection; + return runBlockingOnImeThread(new Callable<Boolean>() { + @Override + public Boolean call() { + return connection.deleteSurroundingTextInCodePoints(before, after); + } + }); + } + + CharSequence getTextBeforeCursor(final int length, final int flags) throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<CharSequence>() { + @Override + public CharSequence call() { + return connection.getTextBeforeCursor(length, flags); + } + }); + } + + CharSequence getSelectedText(final int flags) throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<CharSequence>() { + @Override + public CharSequence call() { + return connection.getSelectedText(flags); + } + }); + } + + CharSequence getTextAfterCursor(final int length, final int flags) throws Exception { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<CharSequence>() { + @Override + public CharSequence call() { + return connection.getTextAfterCursor(length, flags); + } + }); + } + + int getCursorCapsMode(final int reqModes) throws Throwable { + final ChromiumBaseInputConnection connection = mConnection; + return runBlockingOnImeThread(new Callable<Integer>() { + @Override + public Integer call() { + return connection.getCursorCapsMode(reqModes); + } + }); + } + + void dispatchKeyEvent(final KeyEvent event) { + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + mImeAdapter.dispatchKeyEvent(event); + } + }); + } + + /** + * Focus element, wait for a single state update, reset state update list. + * @param id ID of the element to focus. + */ + void focusElementAndWaitForStateUpdate(String id) + throws InterruptedException, TimeoutException { + resetUpdateSelectionList(); + focusElement(id); + waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); + resetUpdateSelectionList(); + } + + void focusElement(final String id) throws InterruptedException, TimeoutException { + focusElement(id, true); + } + + void focusElement(final String id, boolean shouldShowKeyboard) + throws InterruptedException, TimeoutException { + DOMUtils.focusNode(getWebContents(), id); + assertWaitForKeyboardStatus(shouldShowKeyboard); + CriteriaHelper.pollInstrumentationThread(Criteria.equals(id, new Callable<String>() { + @Override + public String call() throws Exception { + return DOMUtils.getFocusedNode(getWebContents()); + } + })); + // When we focus another element, the connection may be recreated. + mConnection = getInputConnection(); + } + + static class TestInputConnectionFactory implements ChromiumBaseInputConnection.Factory { + private final ChromiumBaseInputConnection.Factory mFactory; + + private final List<Integer> mTextInputTypeList = new ArrayList<>(); + private EditorInfo mOutAttrs; + + public TestInputConnectionFactory(ChromiumBaseInputConnection.Factory factory) { + mFactory = factory; + } + + @Override + public ChromiumBaseInputConnection initializeAndGet(View view, ImeAdapter imeAdapter, + int inputType, int inputFlags, int inputMode, int selectionStart, int selectionEnd, + EditorInfo outAttrs) { + mTextInputTypeList.add(inputType); + mOutAttrs = outAttrs; + return mFactory.initializeAndGet(view, imeAdapter, inputType, inputMode, inputFlags, + selectionStart, selectionEnd, outAttrs); + } + + @Override + public Handler getHandler() { + return mFactory.getHandler(); + } + + public Integer[] getTextInputTypeHistory() { + Integer[] result = new Integer[mTextInputTypeList.size()]; + mTextInputTypeList.toArray(result); + return result; + } + + public void clearTextInputTypeHistory() { + mTextInputTypeList.clear(); + } + + public EditorInfo getOutAttrs() { + return mOutAttrs; + } + + @Override + public void onWindowFocusChanged(boolean gainFocus) { + mFactory.onWindowFocusChanged(gainFocus); + } + + @Override + public void onViewFocusChanged(boolean gainFocus) { + mFactory.onViewFocusChanged(gainFocus); + } + + @Override + public void onViewAttachedToWindow() { + mFactory.onViewAttachedToWindow(); + } + + @Override + public void onViewDetachedFromWindow() { + mFactory.onViewDetachedFromWindow(); + } + } +}
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeLollipopTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeLollipopTest.java index 884efc2..5962821 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeLollipopTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeLollipopTest.java
@@ -10,10 +10,17 @@ import android.view.inputmethod.CursorAnchorInfo; import android.view.inputmethod.InputConnection; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.base.test.util.RetryOnFailure; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; @@ -22,9 +29,19 @@ /** * Integration tests for text input for Android L (or above) features. */ +@RunWith(ContentJUnit4ClassRunner.class) @MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP) @TargetApi(Build.VERSION_CODES.LOLLIPOP) -public class ImeLollipopTest extends ImeTest { +public class ImeLollipopTest { + @Rule + public ImeActivityTestRule mRule = new ImeActivityTestRule(); + + @Before + public void setUp() throws Exception { + mRule.setUp(); + } + + @Test @MediumTest @Feature({"TextInput"}) @RetryOnFailure @@ -32,45 +49,45 @@ requestCursorUpdates(InputConnection.CURSOR_UPDATE_MONITOR); // In "MONITOR" mode, the change should be notified. - setComposingText("ab", 1); + mRule.setComposingText("ab", 1); waitForUpdateCursorAnchorInfoComposingText("ab"); - CursorAnchorInfo info = mInputMethodManagerWrapper.getLastCursorAnchorInfo(); - assertEquals(0, info.getComposingTextStart()); - assertNotNull(info.getCharacterBounds(0)); - assertNotNull(info.getCharacterBounds(1)); - assertNull(info.getCharacterBounds(2)); + CursorAnchorInfo info = mRule.getInputMethodManagerWrapper().getLastCursorAnchorInfo(); + Assert.assertEquals(0, info.getComposingTextStart()); + Assert.assertNotNull(info.getCharacterBounds(0)); + Assert.assertNotNull(info.getCharacterBounds(1)); + Assert.assertNull(info.getCharacterBounds(2)); // Should be notified not only once. Further change should be sent, too. - setComposingText("abcd", 1); + mRule.setComposingText("abcd", 1); waitForUpdateCursorAnchorInfoComposingText("abcd"); - info = mInputMethodManagerWrapper.getLastCursorAnchorInfo(); - assertEquals(0, info.getComposingTextStart()); - assertNotNull(info.getCharacterBounds(0)); - assertNotNull(info.getCharacterBounds(1)); - assertNotNull(info.getCharacterBounds(2)); - assertNotNull(info.getCharacterBounds(3)); - assertNull(info.getCharacterBounds(4)); + info = mRule.getInputMethodManagerWrapper().getLastCursorAnchorInfo(); + Assert.assertEquals(0, info.getComposingTextStart()); + Assert.assertNotNull(info.getCharacterBounds(0)); + Assert.assertNotNull(info.getCharacterBounds(1)); + Assert.assertNotNull(info.getCharacterBounds(2)); + Assert.assertNotNull(info.getCharacterBounds(3)); + Assert.assertNull(info.getCharacterBounds(4)); // In "IMMEDIATE" mode, even when there's no change, we should be notified at least once. ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - mInputMethodManagerWrapper.clearLastCursorAnchorInfo(); + mRule.getInputMethodManagerWrapper().clearLastCursorAnchorInfo(); } }); requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE); waitForUpdateCursorAnchorInfoComposingText("abcd"); - setComposingText("abcde", 2); + mRule.setComposingText("abcde", 2); requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE); waitForUpdateCursorAnchorInfoComposingText("abcde"); } private void requestCursorUpdates(final int cursorUpdateMode) throws Exception { - final InputConnection connection = mConnection; - runBlockingOnImeThread(new Callable<Void>() { + final InputConnection connection = mRule.getConnection(); + mRule.runBlockingOnImeThread(new Callable<Void>() { @Override public Void call() { connection.requestCursorUpdates(cursorUpdateMode); @@ -83,7 +100,8 @@ CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { - CursorAnchorInfo info = mInputMethodManagerWrapper.getLastCursorAnchorInfo(); + CursorAnchorInfo info = + mRule.getInputMethodManagerWrapper().getLastCursorAnchorInfo(); if (info != null && info.getComposingText() == null) { updateFailureReason("info.getCompositingText() returned null"); return false;
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java index 67ad4dc2e..52e8f12 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
@@ -4,536 +4,462 @@ package org.chromium.content.browser.input; -import android.annotation.TargetApi; -import android.app.Activity; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.content.res.Configuration; -import android.os.Handler; import android.support.test.filters.MediumTest; import android.support.test.filters.SmallTest; import android.text.InputType; -import android.text.TextUtils; -import android.util.Pair; import android.view.KeyEvent; -import android.view.View; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputConnection; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.UrlUtils; -import org.chromium.content.browser.ContentViewCore; -import org.chromium.content.browser.SelectionPopupController; +import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.DOMUtils; import org.chromium.content.browser.test.util.JavaScriptUtils; -import org.chromium.content.browser.test.util.TestCallbackHelperContainer; -import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; -import org.chromium.content_public.browser.WebContents; -import org.chromium.content_shell_apk.ContentShellTestBase; import org.chromium.ui.base.ime.TextInputType; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; /** * IME (input method editor) and text input tests. */ -public class ImeTest extends ContentShellTestBase { - protected ChromiumBaseInputConnection mConnection; - private TestInputConnectionFactory mConnectionFactory; - private ImeAdapter mImeAdapter; +@RunWith(ContentJUnit4ClassRunner.class) +public class ImeTest { + @Rule + public ImeActivityTestRule mRule = new ImeActivityTestRule(); - private static final String INPUT_FORM_HTML = - "content/test/data/android/input/input_forms.html"; - - private ContentViewCore mContentViewCore; - private WebContents mWebContents; - private SelectionPopupController mSelectionPopupController; - private TestCallbackHelperContainer mCallbackContainer; - protected TestInputMethodManagerWrapper mInputMethodManagerWrapper; - - @Override + @Before public void setUp() throws Exception { - super.setUp(); - startActivityWithTestUrl(INPUT_FORM_HTML); - mContentViewCore = getContentViewCore(); - mSelectionPopupController = mContentViewCore.getSelectionPopupControllerForTesting(); - mWebContents = getWebContents(); - - mInputMethodManagerWrapper = new TestInputMethodManagerWrapper(mContentViewCore) { - private boolean mExpectsSelectionOutsideComposition; - - @Override - public void expectsSelectionOutsideComposition() { - mExpectsSelectionOutsideComposition = true; - } - - @Override - public void onUpdateSelection( - Range oldSel, Range oldComp, Range newSel, Range newComp) { - // We expect that selection will be outside composition in some cases. Keyboard - // app will not finish composition in this case. - if (mExpectsSelectionOutsideComposition) { - mExpectsSelectionOutsideComposition = false; - return; - } - if (oldComp == null || oldComp.start() == oldComp.end() - || newComp.start() == newComp.end()) { - return; - } - // This emulates keyboard app's behavior that finishes composition when - // selection is outside composition. - if (!newSel.intersects(newComp)) { - try { - finishComposingText(); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - } - } - }; - getImeAdapter().setInputMethodManagerWrapperForTest(mInputMethodManagerWrapper); - assertEquals(0, mInputMethodManagerWrapper.getShowSoftInputCounter()); - mConnectionFactory = - new TestInputConnectionFactory(getImeAdapter().getInputConnectionFactoryForTest()); - getImeAdapter().setInputConnectionFactory(mConnectionFactory); - - mCallbackContainer = new TestCallbackHelperContainer(mContentViewCore); - DOMUtils.waitForNonZeroNodeBounds(mWebContents, "input_text"); - boolean result = DOMUtils.clickNode(mContentViewCore, "input_text"); - - assertEquals("Failed to dispatch touch event.", true, result); - assertWaitForKeyboardStatus(true); - - mConnection = getInputConnection(); - mImeAdapter = getImeAdapter(); - - waitForKeyboardStates(1, 0, 1, new Integer[] {TextInputType.TEXT}); - assertEquals(0, mConnectionFactory.getOutAttrs().initialSelStart); - assertEquals(0, mConnectionFactory.getOutAttrs().initialSelEnd); - - waitForEventLogs("selectionchange"); - clearEventLogs(); - - waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); - resetAllStates(); + mRule.setUp(); } - private void fullyLoadUrl(final String url) throws Throwable { - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - getActivity().getActiveShell().loadUrl(url); - } - }); - waitForActiveShellToBeDoneLoading(); - } - + @Test @MediumTest @Feature({"TextInput", "Main"}) public void testKeyboardDismissedWhenNavigating() throws Throwable { - assertWaitForKeyboardStatus(true); + mRule.assertWaitForKeyboardStatus(true); // Hide keyboard when loading a new Url. - fullyLoadUrl(UrlUtils.getIsolatedTestFileUrl(INPUT_FORM_HTML)); - assertWaitForKeyboardStatus(false); + mRule.fullyLoadUrl(UrlUtils.getIsolatedTestFileUrl(ImeActivityTestRule.INPUT_FORM_HTML)); + mRule.assertWaitForKeyboardStatus(false); - DOMUtils.clickNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(true); + DOMUtils.clickNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); // Hide keyboard when navigating. final String code = "document.getElementById(\"link\").click()"; JavaScriptUtils.executeJavaScriptAndWaitForResult( - getContentViewCore().getWebContents(), code); - assertWaitForKeyboardStatus(false); + mRule.getContentViewCore().getWebContents(), code); + mRule.assertWaitForKeyboardStatus(false); } + @Test @MediumTest @Feature({"TextInput", "Main"}) public void testKeyboardDismissedAfterClickingGo() throws Throwable { - setComposingText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); + mRule.setComposingText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); - performGo(mCallbackContainer); + mRule.performGo(mRule.getTestCallBackHelperContainer()); - assertWaitForKeyboardStatus(false); + mRule.assertWaitForKeyboardStatus(false); } + @Test @MediumTest @Feature({"TextInput", "Main"}) public void testDoesNotHang_getTextAfterKeyboardHides() throws Throwable { - setComposingText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); + mRule.setComposingText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); - performGo(mCallbackContainer); + mRule.performGo(mRule.getTestCallBackHelperContainer()); // This may time out if we do not get the information on time. // TODO(changwan): find a way to remove the loop. for (int i = 0; i < 100; ++i) { - getTextBeforeCursor(10, 0); + mRule.getTextBeforeCursor(10, 0); } - assertWaitForKeyboardStatus(false); + mRule.assertWaitForKeyboardStatus(false); } // crbug.com/643519 + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testCompositionWithNullTextNotCrash() throws Throwable { - commitText(null, 1); - assertTextsAroundCursor("", null, ""); + mRule.commitText(null, 1); + mRule.assertTextsAroundCursor("", null, ""); - setComposingText(null, 1); - assertTextsAroundCursor("", null, ""); + mRule.setComposingText(null, 1); + mRule.assertTextsAroundCursor("", null, ""); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testDeleteSurroundingTextWithRangeSelection() throws Throwable { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - setSelection(1, 4); - waitAndVerifyUpdateSelection(1, 1, 4, -1, -1); + mRule.setSelection(1, 4); + mRule.waitAndVerifyUpdateSelection(1, 1, 4, -1, -1); - deleteSurroundingText(0, 0); - assertTextsAroundCursor("h", "ell", "o"); + mRule.deleteSurroundingText(0, 0); + mRule.assertTextsAroundCursor("h", "ell", "o"); - deleteSurroundingText(1, 1); - assertTextsAroundCursor("", "ell", ""); + mRule.deleteSurroundingText(1, 1); + mRule.assertTextsAroundCursor("", "ell", ""); - deleteSurroundingText(1, 0); - assertTextsAroundCursor("", "ell", ""); + mRule.deleteSurroundingText(1, 0); + mRule.assertTextsAroundCursor("", "ell", ""); - deleteSurroundingText(0, 1); - assertTextsAroundCursor("", "ell", ""); + mRule.deleteSurroundingText(0, 1); + mRule.assertTextsAroundCursor("", "ell", ""); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testDeleteSurroundingTextWithCursorSelection() throws Throwable { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - setSelection(2, 2); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.setSelection(2, 2); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); - deleteSurroundingText(0, 0); - assertTextsAroundCursor("he", null, "llo"); + mRule.deleteSurroundingText(0, 0); + mRule.assertTextsAroundCursor("he", null, "llo"); - deleteSurroundingText(1, 1); - assertTextsAroundCursor("h", null, "lo"); + mRule.deleteSurroundingText(1, 1); + mRule.assertTextsAroundCursor("h", null, "lo"); - deleteSurroundingText(1, 0); - assertTextsAroundCursor("", null, "lo"); + mRule.deleteSurroundingText(1, 0); + mRule.assertTextsAroundCursor("", null, "lo"); - deleteSurroundingText(0, 10); - assertTextsAroundCursor("", null, ""); + mRule.deleteSurroundingText(0, 10); + mRule.assertTextsAroundCursor("", null, ""); - deleteSurroundingText(10, 10); - assertTextsAroundCursor("", null, ""); + mRule.deleteSurroundingText(10, 10); + mRule.assertTextsAroundCursor("", null, ""); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testKeyboardAppFinishesCompositionOnUnexpectedSelectionChange() throws Throwable { - focusElementAndWaitForStateUpdate("textarea2"); - commitText("12345", 1); - setSelection(3, 3); - setComposingRegion(2, 3); + mRule.focusElementAndWaitForStateUpdate("textarea2"); + mRule.commitText("12345", 1); + mRule.setSelection(3, 3); + mRule.setComposingRegion(2, 3); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - waitAndVerifyUpdateSelection(1, 3, 3, -1, -1); - waitAndVerifyUpdateSelection(2, 3, 3, 2, 3); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.waitAndVerifyUpdateSelection(1, 3, 3, -1, -1); + mRule.waitAndVerifyUpdateSelection(2, 3, 3, 2, 3); // Unexpected selection change occurs, e.g., the user clicks on an area. - DOMUtils.clickNode(mContentViewCore, "textarea2"); - waitAndVerifyUpdateSelection(3, 5, 5, 2, 3); + DOMUtils.clickNode(mRule.getContentViewCore(), "textarea2"); + mRule.waitAndVerifyUpdateSelection(3, 5, 5, 2, 3); // Keyboard app finishes composition. We emulate this in TestInputMethodManagerWrapper. - waitAndVerifyUpdateSelection(4, 5, 5, -1, -1); + mRule.waitAndVerifyUpdateSelection(4, 5, 5, -1, -1); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testDeleteSurroundingTextInCodePointsWithRangeSelection() throws Throwable { final String trophy = "\uD83C\uDFC6"; - commitText("ab" + trophy + "cdef" + trophy + "gh", 1); - waitAndVerifyUpdateSelection(0, 12, 12, -1, -1); + mRule.commitText("ab" + trophy + "cdef" + trophy + "gh", 1); + mRule.waitAndVerifyUpdateSelection(0, 12, 12, -1, -1); - setSelection(6, 8); - waitAndVerifyUpdateSelection(1, 6, 8, -1, -1); - assertTextsAroundCursor("ab" + trophy + "cd", "ef", trophy + "gh"); + mRule.setSelection(6, 8); + mRule.waitAndVerifyUpdateSelection(1, 6, 8, -1, -1); + mRule.assertTextsAroundCursor("ab" + trophy + "cd", "ef", trophy + "gh"); - deleteSurroundingTextInCodePoints(2, 2); - waitAndVerifyUpdateSelection(2, 4, 6, -1, -1); - assertTextsAroundCursor("ab" + trophy, "ef", "h"); + mRule.deleteSurroundingTextInCodePoints(2, 2); + mRule.waitAndVerifyUpdateSelection(2, 4, 6, -1, -1); + mRule.assertTextsAroundCursor("ab" + trophy, "ef", "h"); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testDeleteSurroundingTextInCodePointsWithCursorSelection() throws Throwable { final String trophy = "\uD83C\uDFC6"; - commitText("ab" + trophy + "cd" + trophy, 1); - waitAndVerifyUpdateSelection(0, 8, 8, -1, -1); + mRule.commitText("ab" + trophy + "cd" + trophy, 1); + mRule.waitAndVerifyUpdateSelection(0, 8, 8, -1, -1); - setSelection(4, 4); - waitAndVerifyUpdateSelection(1, 4, 4, -1, -1); - assertTextsAroundCursor("ab" + trophy, null, "cd" + trophy); + mRule.setSelection(4, 4); + mRule.waitAndVerifyUpdateSelection(1, 4, 4, -1, -1); + mRule.assertTextsAroundCursor("ab" + trophy, null, "cd" + trophy); - deleteSurroundingTextInCodePoints(2, 2); - waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); - assertTextsAroundCursor("a", null, trophy); + mRule.deleteSurroundingTextInCodePoints(2, 2); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + mRule.assertTextsAroundCursor("a", null, trophy); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testSetComposingTextForNewCursorPositions() throws Throwable { // Cursor is on the right of composing text when newCursorPosition > 0. - setComposingText("ab", 1); - waitAndVerifyUpdateSelection(0, 2, 2, 0, 2); + mRule.setComposingText("ab", 1); + mRule.waitAndVerifyUpdateSelection(0, 2, 2, 0, 2); - finishComposingText(); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.finishComposingText(); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); // Cursor exceeds the left boundary. - setComposingText("cdef", -100); - waitAndVerifyUpdateSelection(2, 0, 0, 2, 6); + mRule.setComposingText("cdef", -100); + mRule.waitAndVerifyUpdateSelection(2, 0, 0, 2, 6); // Cursor is on the left boundary. - mInputMethodManagerWrapper.expectsSelectionOutsideComposition(); - setComposingText("cd", -2); - waitAndVerifyUpdateSelection(3, 0, 0, 2, 4); + mRule.getInputMethodManagerWrapper().expectsSelectionOutsideComposition(); + mRule.setComposingText("cd", -2); + mRule.waitAndVerifyUpdateSelection(3, 0, 0, 2, 4); - mInputMethodManagerWrapper.expectsSelectionOutsideComposition(); + mRule.getInputMethodManagerWrapper().expectsSelectionOutsideComposition(); // Cursor is between the left boundary and the composing text. - setComposingText("cd", -1); - waitAndVerifyUpdateSelection(4, 1, 1, 2, 4); + mRule.setComposingText("cd", -1); + mRule.waitAndVerifyUpdateSelection(4, 1, 1, 2, 4); // Cursor is on the left of composing text. - setComposingText("cd", 0); - waitAndVerifyUpdateSelection(5, 2, 2, 2, 4); + mRule.setComposingText("cd", 0); + mRule.waitAndVerifyUpdateSelection(5, 2, 2, 2, 4); - finishComposingText(); - waitAndVerifyUpdateSelection(6, 2, 2, -1, -1); + mRule.finishComposingText(); + mRule.waitAndVerifyUpdateSelection(6, 2, 2, -1, -1); // Cursor is on the right of composing text. - setComposingText("ef", 1); - waitAndVerifyUpdateSelection(7, 4, 4, 2, 4); + mRule.setComposingText("ef", 1); + mRule.waitAndVerifyUpdateSelection(7, 4, 4, 2, 4); - mInputMethodManagerWrapper.expectsSelectionOutsideComposition(); + mRule.getInputMethodManagerWrapper().expectsSelectionOutsideComposition(); // Cursor is between the composing text and the right boundary. - setComposingText("ef", 2); - waitAndVerifyUpdateSelection(8, 5, 5, 2, 4); + mRule.setComposingText("ef", 2); + mRule.waitAndVerifyUpdateSelection(8, 5, 5, 2, 4); - mInputMethodManagerWrapper.expectsSelectionOutsideComposition(); + mRule.getInputMethodManagerWrapper().expectsSelectionOutsideComposition(); // Cursor is on the right boundary. - setComposingText("ef", 3); - waitAndVerifyUpdateSelection(9, 6, 6, 2, 4); + mRule.setComposingText("ef", 3); + mRule.waitAndVerifyUpdateSelection(9, 6, 6, 2, 4); - mInputMethodManagerWrapper.expectsSelectionOutsideComposition(); + mRule.getInputMethodManagerWrapper().expectsSelectionOutsideComposition(); // Cursor exceeds the right boundary. - setComposingText("efgh", 100); - waitAndVerifyUpdateSelection(10, 8, 8, 2, 6); + mRule.setComposingText("efgh", 100); + mRule.waitAndVerifyUpdateSelection(10, 8, 8, 2, 6); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testCommitTextForNewCursorPositions() throws Throwable { // Cursor is on the left of committing text. - commitText("ab", 0); - waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); + mRule.commitText("ab", 0); + mRule.waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); // Cursor is on the right of committing text. - commitText("cd", 1); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.commitText("cd", 1); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); // Cursor is between the committing text and the right boundary. - commitText("ef", 2); - waitAndVerifyUpdateSelection(2, 5, 5, -1, -1); + mRule.commitText("ef", 2); + mRule.waitAndVerifyUpdateSelection(2, 5, 5, -1, -1); // Cursor is between the left boundary and the committing text. - commitText("gh", -3); - waitAndVerifyUpdateSelection(3, 2, 2, -1, -1); + mRule.commitText("gh", -3); + mRule.waitAndVerifyUpdateSelection(3, 2, 2, -1, -1); // Cursor is on the right boundary. - commitText("ij", 7); - waitAndVerifyUpdateSelection(4, 10, 10, -1, -1); + mRule.commitText("ij", 7); + mRule.waitAndVerifyUpdateSelection(4, 10, 10, -1, -1); // Cursor is on the left boundary. - commitText("kl", -10); - waitAndVerifyUpdateSelection(5, 0, 0, -1, -1); + mRule.commitText("kl", -10); + mRule.waitAndVerifyUpdateSelection(5, 0, 0, -1, -1); // Cursor exceeds the right boundary. - commitText("mn", 100); - waitAndVerifyUpdateSelection(6, 14, 14, -1, -1); + mRule.commitText("mn", 100); + mRule.waitAndVerifyUpdateSelection(6, 14, 14, -1, -1); // Cursor exceeds the left boundary. - commitText("op", -100); - waitAndVerifyUpdateSelection(7, 0, 0, -1, -1); + mRule.commitText("op", -100); + mRule.waitAndVerifyUpdateSelection(7, 0, 0, -1, -1); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testSetComposingTextWithEmptyText() throws Throwable { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - setComposingText("AB", 1); - waitAndVerifyUpdateSelection(1, 7, 7, 5, 7); + mRule.setComposingText("AB", 1); + mRule.waitAndVerifyUpdateSelection(1, 7, 7, 5, 7); // With previous composition. - setComposingText("", -3); - waitAndVerifyUpdateSelection(2, 2, 2, -1, -1); - assertTextsAroundCursor("he", null, "llo"); + mRule.setComposingText("", -3); + mRule.waitAndVerifyUpdateSelection(2, 2, 2, -1, -1); + mRule.assertTextsAroundCursor("he", null, "llo"); // Without previous composition. - setComposingText("", 3); - waitAndVerifyUpdateSelection(3, 4, 4, -1, -1); - assertTextsAroundCursor("hell", null, "o"); + mRule.setComposingText("", 3); + mRule.waitAndVerifyUpdateSelection(3, 4, 4, -1, -1); + mRule.assertTextsAroundCursor("hell", null, "o"); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testCommitTextWithEmptyText() throws Throwable { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - setSelection(2, 2); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.setSelection(2, 2); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); - setComposingText("world", 1); - waitAndVerifyUpdateSelection(2, 7, 7, 2, 7); + mRule.setComposingText("world", 1); + mRule.waitAndVerifyUpdateSelection(2, 7, 7, 2, 7); // With previous composition. - commitText("", 2); - waitAndVerifyUpdateSelection(3, 3, 3, -1, -1); + mRule.commitText("", 2); + mRule.waitAndVerifyUpdateSelection(3, 3, 3, -1, -1); // Without previous composition. - commitText("", -1); - waitAndVerifyUpdateSelection(4, 2, 2, -1, -1); + mRule.commitText("", -1); + mRule.waitAndVerifyUpdateSelection(4, 2, 2, -1, -1); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testCommitWhileComposingText() throws Throwable { - setComposingText("h", 1); - waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); + mRule.setComposingText("h", 1); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); - setComposingText("he", 1); - waitAndVerifyUpdateSelection(1, 2, 2, 0, 2); + mRule.setComposingText("he", 1); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, 0, 2); - setComposingText("hel", 1); - waitAndVerifyUpdateSelection(2, 3, 3, 0, 3); + mRule.setComposingText("hel", 1); + mRule.waitAndVerifyUpdateSelection(2, 3, 3, 0, 3); - commitText("hel", 1); - waitAndVerifyUpdateSelection(3, 3, 3, -1, -1); + mRule.commitText("hel", 1); + mRule.waitAndVerifyUpdateSelection(3, 3, 3, -1, -1); - setComposingText("lo", 1); - waitAndVerifyUpdateSelection(4, 5, 5, 3, 5); + mRule.setComposingText("lo", 1); + mRule.waitAndVerifyUpdateSelection(4, 5, 5, 3, 5); - commitText("", 1); - waitAndVerifyUpdateSelection(5, 3, 3, -1, -1); + mRule.commitText("", 1); + mRule.waitAndVerifyUpdateSelection(5, 3, 3, -1, -1); - assertTextsAroundCursor("hel", null, ""); + mRule.assertTextsAroundCursor("hel", null, ""); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testCommitEnterKeyWhileComposingText() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); + mRule.focusElementAndWaitForStateUpdate("textarea"); - setComposingText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); + mRule.setComposingText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); // Cancel the current composition and replace it with enter. - commitText("\n", 1); - waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); + mRule.commitText("\n", 1); + mRule.waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); // The second new line is not a user visible/editable one, it is a side-effect of Blink // using <br> internally. This only happens when \n is at the end. - assertTextsAroundCursor("\n", null, "\n"); + mRule.assertTextsAroundCursor("\n", null, "\n"); - commitText("world", 1); - waitAndVerifyUpdateSelection(2, 6, 6, -1, -1); - assertTextsAroundCursor("\nworld", null, ""); + mRule.commitText("world", 1); + mRule.waitAndVerifyUpdateSelection(2, 6, 6, -1, -1); + mRule.assertTextsAroundCursor("\nworld", null, ""); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeCopy() throws Exception { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - setSelection(2, 5); - waitAndVerifyUpdateSelection(1, 2, 5, -1, -1); + mRule.setSelection(2, 5); + mRule.waitAndVerifyUpdateSelection(1, 2, 5, -1, -1); - copy(); - assertClipboardContents(getActivity(), "llo"); + mRule.copy(); + mRule.assertClipboardContents(mRule.getActivity(), "llo"); } + @Test @SmallTest @Feature({"TextInput"}) public void testEnterTextAndRefocus() throws Exception { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - restartInput(); - DOMUtils.clickNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(true); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.restartInput(); + DOMUtils.clickNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); - assertEquals(5, mConnectionFactory.getOutAttrs().initialSelStart); - assertEquals(5, mConnectionFactory.getOutAttrs().initialSelEnd); + Assert.assertEquals(5, mRule.getConnectionFactory().getOutAttrs().initialSelStart); + Assert.assertEquals(5, mRule.getConnectionFactory().getOutAttrs().initialSelEnd); } + @Test @SmallTest @DisabledTest(message = "crbug.com/694812") @Feature({"TextInput"}) public void testShowAndHideSoftInput() throws Exception { - focusElement("input_radio", false); + mRule.focusElement("input_radio", false); - // hideSoftKeyboard(), restartInput() - waitForKeyboardStates(0, 1, 1, new Integer[] {}); + // hideSoftKeyboard(), mRule.restartInput() + mRule.waitForKeyboardStates(0, 1, 1, new Integer[] {}); // When input connection is null, we still need to set flags to prevent InputMethodService // from entering fullscreen mode and from opening custom UI. CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { - return getInputConnection() == null; + return mRule.getInputConnection() == null; } }); - assertTrue( - (mConnectionFactory.getOutAttrs().imeOptions + Assert.assertTrue( + (mRule.getConnectionFactory().getOutAttrs().imeOptions & (EditorInfo.IME_FLAG_NO_FULLSCREEN | EditorInfo.IME_FLAG_NO_EXTRACT_UI)) != 0); - // showSoftInput(), restartInput() - focusElement("input_number1"); - waitForKeyboardStates(1, 1, 2, new Integer[] {TextInputType.NUMBER}); - assertNotNull(mInputMethodManagerWrapper.getInputConnection()); + // showSoftInput(), mRule.restartInput() + mRule.focusElement("input_number1"); + mRule.waitForKeyboardStates(1, 1, 2, new Integer[] {TextInputType.NUMBER}); + Assert.assertNotNull(mRule.getInputMethodManagerWrapper().getInputConnection()); - focusElement("input_number2"); + mRule.focusElement("input_number2"); // Hide should never be called here. Otherwise we will see a flicker. Restarted to // reset internal states to handle the new input form. - waitForKeyboardStates(2, 1, 3, new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER}); + mRule.waitForKeyboardStates( + 2, 1, 3, new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER}); - focusElement("input_text"); - // showSoftInput() on input_text. restartInput() on input_number1 due to focus change, - // and restartInput() on input_text later. - waitForKeyboardStates(3, 1, 4, + mRule.focusElement("input_text"); + // showSoftInput() on input_text. mRule.restartInput() on input_number1 due to focus change, + // and mRule.restartInput() on input_text later. + mRule.waitForKeyboardStates(3, 1, 4, new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT}); - resetUpdateSelectionList(); - setComposingText("a", 1); - waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); - resetUpdateSelectionList(); + mRule.resetUpdateSelectionList(); + mRule.setComposingText("a", 1); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); + mRule.resetUpdateSelectionList(); // JavaScript changes focus. String code = "(function() { " @@ -541,168 +467,139 @@ + "textarea.focus();" + "})();"; JavaScriptUtils.executeJavaScriptAndWaitForResult( - getContentViewCore().getWebContents(), code); - waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); - resetUpdateSelectionList(); + mRule.getContentViewCore().getWebContents(), code); + mRule.waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); + mRule.resetUpdateSelectionList(); - waitForKeyboardStates(4, 1, 5, new Integer[] { - TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT, - TextInputType.TEXT_AREA}); - assertEquals(0, mConnectionFactory.getOutAttrs().initialSelStart); - assertEquals(0, mConnectionFactory.getOutAttrs().initialSelEnd); + mRule.waitForKeyboardStates(4, 1, 5, + new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT, + TextInputType.TEXT_AREA}); + Assert.assertEquals(0, mRule.getConnectionFactory().getOutAttrs().initialSelStart); + Assert.assertEquals(0, mRule.getConnectionFactory().getOutAttrs().initialSelEnd); - setComposingText("aa", 1); - waitAndVerifyUpdateSelection(0, 2, 2, 0, 2); + mRule.setComposingText("aa", 1); + mRule.waitAndVerifyUpdateSelection(0, 2, 2, 0, 2); - focusElement("input_text"); - waitForKeyboardStates(5, 1, 6, new Integer[] { - TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT, - TextInputType.TEXT_AREA, TextInputType.TEXT}); - assertEquals(1, mConnectionFactory.getOutAttrs().initialSelStart); - assertEquals(1, mConnectionFactory.getOutAttrs().initialSelEnd); + mRule.focusElement("input_text"); + mRule.waitForKeyboardStates(5, 1, 6, + new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT, + TextInputType.TEXT_AREA, TextInputType.TEXT}); + Assert.assertEquals(1, mRule.getConnectionFactory().getOutAttrs().initialSelStart); + Assert.assertEquals(1, mRule.getConnectionFactory().getOutAttrs().initialSelEnd); - focusElement("input_radio", false); - // hideSoftInput(), restartInput() - waitForKeyboardStates(5, 2, 7, new Integer[] { - TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT, - TextInputType.TEXT_AREA, TextInputType.TEXT}); + mRule.focusElement("input_radio", false); + // hideSoftInput(), mRule.restartInput() + mRule.waitForKeyboardStates(5, 2, 7, + new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT, + TextInputType.TEXT_AREA, TextInputType.TEXT}); } - - private void assertTextsAroundCursor( - CharSequence before, CharSequence selected, CharSequence after) throws Exception { - assertEquals(before, getTextBeforeCursor(100, 0)); - assertEquals(selected, getSelectedText(0)); - assertEquals(after, getTextAfterCursor(100, 0)); - } - - private void waitForKeyboardStates(int show, int hide, int restart, Integer[] history) { - final String expected = stringifyKeyboardStates(show, hide, restart, history); - CriteriaHelper.pollUiThread(Criteria.equals(expected, new Callable<String>() { - @Override - public String call() { - return getKeyboardStates(); - } - })); - } - - private void resetAllStates() { - mInputMethodManagerWrapper.reset(); - mConnectionFactory.clearTextInputTypeHistory(); - } - - private String getKeyboardStates() { - int showCount = mInputMethodManagerWrapper.getShowSoftInputCounter(); - int hideCount = mInputMethodManagerWrapper.getHideSoftInputCounter(); - int restartCount = mInputMethodManagerWrapper.getRestartInputCounter(); - Integer[] history = mConnectionFactory.getTextInputTypeHistory(); - return stringifyKeyboardStates(showCount, hideCount, restartCount, history); - } - - private String stringifyKeyboardStates(int show, int hide, int restart, Integer[] history) { - return "show count: " + show + ", hide count: " + hide + ", restart count: " + restart - + ", input type history: " + Arrays.deepToString(history); - } - + @Test @SmallTest @Feature({"TextInput"}) public void testKeyboardNotDismissedAfterCopySelection() throws Exception { - commitText("Sample Text", 1); - waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); + mRule.commitText("Sample Text", 1); + mRule.waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); // Select 'text' part. - DOMUtils.longPressNode(mContentViewCore, "input_text"); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); - assertWaitForSelectActionBarStatus(true); + mRule.assertWaitForSelectActionBarStatus(true); - selectAll(); - copy(); - assertClipboardContents(getActivity(), "Sample Text"); - assertEquals(11, mInputMethodManagerWrapper.getSelection().end()); - assertWaitForKeyboardStatus(true); + mRule.selectAll(); + mRule.copy(); + mRule.assertClipboardContents(mRule.getActivity(), "Sample Text"); + Assert.assertEquals(11, mRule.getInputMethodManagerWrapper().getSelection().end()); + mRule.assertWaitForKeyboardStatus(true); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeNotDismissedAfterCutSelection() throws Exception { - commitText("Sample Text", 1); - waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForSelectActionBarStatus(true); - assertWaitForKeyboardStatus(true); - cut(); - assertWaitForKeyboardStatus(true); - assertWaitForSelectActionBarStatus(false); + mRule.commitText("Sample Text", 1); + mRule.waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForSelectActionBarStatus(true); + mRule.assertWaitForKeyboardStatus(true); + mRule.cut(); + mRule.assertWaitForKeyboardStatus(true); + mRule.assertWaitForSelectActionBarStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeNotShownOnLongPressingEmptyInput() throws Exception { - DOMUtils.focusNode(mWebContents, "input_radio"); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(false); - commitText("Sample Text", 1); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(true); + DOMUtils.focusNode(mRule.getWebContents(), "input_radio"); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(false); + mRule.commitText("Sample Text", 1); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); } + @Test @SmallTest @Feature({"TextInput"}) public void testSelectActionBarShownOnLongPressingInput() throws Exception { - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForSelectActionBarStatus(false); - commitText("Sample Text", 1); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForSelectActionBarStatus(true); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForSelectActionBarStatus(false); + mRule.commitText("Sample Text", 1); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForSelectActionBarStatus(true); } + @Test @SmallTest @Feature({"TextInput"}) public void testLongPressInputWhileComposingText() throws Exception { - assertWaitForSelectActionBarStatus(false); - setComposingText("Sample Text", 1); - waitAndVerifyUpdateSelection(0, 11, 11, 0, 11); - DOMUtils.longPressNode(mContentViewCore, "input_text"); + mRule.assertWaitForSelectActionBarStatus(false); + mRule.setComposingText("Sample Text", 1); + mRule.waitAndVerifyUpdateSelection(0, 11, 11, 0, 11); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); - assertWaitForSelectActionBarStatus(true); + mRule.assertWaitForSelectActionBarStatus(true); // Long press will first change selection region, and then trigger IME app to show up. // See RenderFrameImpl::didChangeSelection() and RenderWidget::didHandleGestureEvent(). - waitAndVerifyUpdateSelection(1, 7, 11, 0, 11); + mRule.waitAndVerifyUpdateSelection(1, 7, 11, 0, 11); // Now IME app wants to finish composing text because an external selection // change has been detected. At least Google Latin IME and Samsung IME // behave this way. - finishComposingText(); - waitAndVerifyUpdateSelection(2, 7, 11, -1, -1); + mRule.finishComposingText(); + mRule.waitAndVerifyUpdateSelection(2, 7, 11, -1, -1); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeShownWhenLongPressOnAlreadySelectedText() throws Exception { - assertWaitForSelectActionBarStatus(false); - commitText("Sample Text", 1); + mRule.assertWaitForSelectActionBarStatus(false); + mRule.commitText("Sample Text", 1); - int showCount = mInputMethodManagerWrapper.getShowSoftInputCounter(); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForSelectActionBarStatus(true); - assertEquals(showCount + 1, mInputMethodManagerWrapper.getShowSoftInputCounter()); + int showCount = mRule.getInputMethodManagerWrapper().getShowSoftInputCounter(); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForSelectActionBarStatus(true); + Assert.assertEquals( + showCount + 1, mRule.getInputMethodManagerWrapper().getShowSoftInputCounter()); // Now long press again. Selection region remains the same, but the logic // should trigger IME to show up. Note that Android does not provide show / // hide status of IME, so we will just check whether showIme() has been triggered. - DOMUtils.longPressNode(mContentViewCore, "input_text"); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); final int newCount = showCount + 2; CriteriaHelper.pollUiThread(Criteria.equals(newCount, new Callable<Integer>() { @Override public Integer call() { - return mInputMethodManagerWrapper.getShowSoftInputCounter(); + return mRule.getInputMethodManagerWrapper().getShowSoftInputCounter(); } })); } private void attachPhysicalKeyboard() { - Configuration hardKeyboardConfig = - new Configuration(mContentViewCore.getContext().getResources().getConfiguration()); + Configuration hardKeyboardConfig = new Configuration( + mRule.getContentViewCore().getContext().getResources().getConfiguration()); hardKeyboardConfig.keyboard = Configuration.KEYBOARD_QWERTY; hardKeyboardConfig.keyboardHidden = Configuration.KEYBOARDHIDDEN_YES; hardKeyboardConfig.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO; @@ -710,8 +607,8 @@ } private void detachPhysicalKeyboard() { - Configuration softKeyboardConfig = - new Configuration(mContentViewCore.getContext().getResources().getConfiguration()); + Configuration softKeyboardConfig = new Configuration( + mRule.getContentViewCore().getContext().getResources().getConfiguration()); softKeyboardConfig.keyboard = Configuration.KEYBOARD_NOKEYS; softKeyboardConfig.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO; softKeyboardConfig.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_YES; @@ -722,34 +619,37 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - mContentViewCore.onConfigurationChanged(config); + mRule.getContentViewCore().onConfigurationChanged(config); } }); } private void reloadPage() throws Throwable { // Reload the page, then focus will be lost and keyboard should be hidden. - fullyLoadUrl(getContentViewCore().getWebContents().getUrl()); + mRule.fullyLoadUrl(mRule.getContentViewCore().getWebContents().getUrl()); } + @Test @SmallTest @Feature({"TextInput"}) public void testPhysicalKeyboard_AttachDetach() throws Throwable { attachPhysicalKeyboard(); // We still call showSoftKeyboard, which will be ignored by physical keyboard. - waitForKeyboardStates(1, 0, 1, new Integer[] {TextInputType.TEXT}); - setComposingText("a", 1); - waitForKeyboardStates(1, 0, 1, new Integer[] {TextInputType.TEXT}); + mRule.waitForKeyboardStates(1, 0, 1, new Integer[] {TextInputType.TEXT}); + mRule.setComposingText("a", 1); + mRule.waitForKeyboardStates(1, 0, 1, new Integer[] {TextInputType.TEXT}); detachPhysicalKeyboard(); - assertWaitForKeyboardStatus(true); - // Now we really show soft keyboard. We also call restartInput when configuration changes. - waitForKeyboardStates(2, 0, 2, new Integer[] {TextInputType.TEXT, TextInputType.TEXT}); + mRule.assertWaitForKeyboardStatus(true); + // Now we really show soft keyboard. We also call mRule.restartInput when configuration + // changes. + mRule.waitForKeyboardStates( + 2, 0, 2, new Integer[] {TextInputType.TEXT, TextInputType.TEXT}); reloadPage(); - // Depending on the timing, hideSoftInput and restartInput call counts may vary here + // Depending on the timing, hideSoftInput and mRule.restartInput call counts may vary here // because render widget gets restarted. But the end result should be the same. - assertWaitForKeyboardStatus(false); + mRule.assertWaitForKeyboardStatus(false); detachPhysicalKeyboard(); @@ -758,87 +658,93 @@ CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { - return mInputMethodManagerWrapper.isShowWithoutHideOutstanding(); + return mRule.getInputMethodManagerWrapper().isShowWithoutHideOutstanding(); } }); - fail("Keyboard incorrectly showing"); + Assert.fail("Keyboard incorrectly showing"); } catch (AssertionError e) { // TODO(tedchoc): This is horrible and should never timeout to determine success. } } + @Test @SmallTest @Feature({"TextInput"}) public void testSelectActionBarClearedOnTappingInput() throws Exception { - commitText("Sample Text", 1); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(true); - assertWaitForSelectActionBarStatus(true); - DOMUtils.clickNode(mContentViewCore, "input_text"); - assertWaitForSelectActionBarStatus(false); + mRule.commitText("Sample Text", 1); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); + mRule.assertWaitForSelectActionBarStatus(true); + DOMUtils.clickNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForSelectActionBarStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testSelectActionBarClearedOnTappingOutsideInput() throws Exception { - commitText("Sample Text", 1); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(true); - assertWaitForSelectActionBarStatus(true); - DOMUtils.clickNode(mContentViewCore, "plain_text"); - assertWaitForKeyboardStatus(false); - assertWaitForSelectActionBarStatus(false); + mRule.commitText("Sample Text", 1); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); + mRule.assertWaitForSelectActionBarStatus(true); + DOMUtils.clickNode(mRule.getContentViewCore(), "plain_text"); + mRule.assertWaitForKeyboardStatus(false); + mRule.assertWaitForSelectActionBarStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeNotShownOnLongPressingDifferentEmptyInputs() throws Exception { - DOMUtils.focusNode(mWebContents, "input_radio"); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(false); - DOMUtils.longPressNode(mContentViewCore, "textarea"); - assertWaitForKeyboardStatus(false); + DOMUtils.focusNode(mRule.getWebContents(), "input_radio"); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(false); + DOMUtils.longPressNode(mRule.getContentViewCore(), "textarea"); + mRule.assertWaitForKeyboardStatus(false); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeStaysOnLongPressingDifferentNonEmptyInputs() throws Exception { - DOMUtils.focusNode(mWebContents, "input_text"); - assertWaitForKeyboardStatus(true); + DOMUtils.focusNode(mRule.getWebContents(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); - commitText("Sample Text", 1); + mRule.commitText("Sample Text", 1); // We should wait to avoid race condition. - waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); + mRule.waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); - DOMUtils.focusNode(mWebContents, "textarea"); - waitAndVerifyUpdateSelection(1, 0, 0, -1, -1); + DOMUtils.focusNode(mRule.getWebContents(), "textarea"); + mRule.waitAndVerifyUpdateSelection(1, 0, 0, -1, -1); - commitText("Sample Text", 1); - waitAndVerifyUpdateSelection(2, 11, 11, -1, -1); + mRule.commitText("Sample Text", 1); + mRule.waitAndVerifyUpdateSelection(2, 11, 11, -1, -1); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForKeyboardStatus(true); - assertWaitForSelectActionBarStatus(true); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); + mRule.assertWaitForSelectActionBarStatus(true); - DOMUtils.longPressNode(mContentViewCore, "textarea"); - assertWaitForKeyboardStatus(true); + DOMUtils.longPressNode(mRule.getContentViewCore(), "textarea"); + mRule.assertWaitForKeyboardStatus(true); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeCut() throws Exception { - commitText("snarful", 1); - waitAndVerifyUpdateSelection(0, 7, 7, -1, -1); + mRule.commitText("snarful", 1); + mRule.waitAndVerifyUpdateSelection(0, 7, 7, -1, -1); - setSelection(1, 5); - waitAndVerifyUpdateSelection(1, 1, 5, -1, -1); + mRule.setSelection(1, 5); + mRule.waitAndVerifyUpdateSelection(1, 1, 5, -1, -1); - cut(); - waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); - assertTextsAroundCursor("s", null, "ul"); - assertClipboardContents(getActivity(), "narf"); + mRule.cut(); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + mRule.assertTextsAroundCursor("s", null, "ul"); + mRule.assertClipboardContents(mRule.getActivity(), "narf"); } + @Test @SmallTest @Feature({"TextInput"}) public void testImePaste() throws Exception { @@ -846,645 +752,668 @@ @Override public void run() { ClipboardManager clipboardManager = - (ClipboardManager) getActivity().getSystemService( + (ClipboardManager) mRule.getActivity().getSystemService( Context.CLIPBOARD_SERVICE); clipboardManager.setPrimaryClip(ClipData.newPlainText("blarg", "blarg")); } }); - paste(); + mRule.paste(); // Paste is a two step process when there is a non-zero selection. - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - assertTextsAroundCursor("blarg", null, ""); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.assertTextsAroundCursor("blarg", null, ""); - setSelection(3, 5); - waitAndVerifyUpdateSelection(1, 3, 5, -1, -1); - assertTextsAroundCursor("bla", "rg", ""); + mRule.setSelection(3, 5); + mRule.waitAndVerifyUpdateSelection(1, 3, 5, -1, -1); + mRule.assertTextsAroundCursor("bla", "rg", ""); - paste(); + mRule.paste(); // Paste is a two step process when there is a non-zero selection. - waitAndVerifyUpdateSelection(2, 8, 8, -1, -1); - assertTextsAroundCursor("blablarg", null, ""); + mRule.waitAndVerifyUpdateSelection(2, 8, 8, -1, -1); + mRule.assertTextsAroundCursor("blablarg", null, ""); - paste(); - waitAndVerifyUpdateSelection(3, 13, 13, -1, -1); - assertTextsAroundCursor("blablargblarg", null, ""); + mRule.paste(); + mRule.waitAndVerifyUpdateSelection(3, 13, 13, -1, -1); + mRule.assertTextsAroundCursor("blablargblarg", null, ""); } + @Test @SmallTest @Feature({"TextInput"}) public void testImeSelectAndCollapseSelection() throws Exception { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - selectAll(); - waitAndVerifyUpdateSelection(1, 0, 5, -1, -1); + mRule.selectAll(); + mRule.waitAndVerifyUpdateSelection(1, 0, 5, -1, -1); - collapseSelection(); - waitAndVerifyUpdateSelection(2, 5, 5, -1, -1); + mRule.collapseSelection(); + mRule.waitAndVerifyUpdateSelection(2, 5, 5, -1, -1); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testShowImeIfNeeded() throws Throwable { // showImeIfNeeded() is now implicitly called by the updated focus // heuristic so no need to call explicitly. http://crbug.com/371927 - DOMUtils.focusNode(mWebContents, "input_radio"); - assertWaitForKeyboardStatus(false); + DOMUtils.focusNode(mRule.getWebContents(), "input_radio"); + mRule.assertWaitForKeyboardStatus(false); - DOMUtils.focusNode(mWebContents, "input_text"); - assertWaitForKeyboardStatus(true); + DOMUtils.focusNode(mRule.getWebContents(), "input_text"); + mRule.assertWaitForKeyboardStatus(true); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testFinishComposingText() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); + mRule.focusElementAndWaitForStateUpdate("textarea"); - commitText("hllo", 1); - waitAndVerifyUpdateSelection(0, 4, 4, -1, -1); + mRule.commitText("hllo", 1); + mRule.waitAndVerifyUpdateSelection(0, 4, 4, -1, -1); - commitText(" ", 1); - waitAndVerifyUpdateSelection(1, 5, 5, -1, -1); + mRule.commitText(" ", 1); + mRule.waitAndVerifyUpdateSelection(1, 5, 5, -1, -1); - setSelection(1, 1); - waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); - assertTextsAroundCursor("h", null, "llo "); + mRule.setSelection(1, 1); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + mRule.assertTextsAroundCursor("h", null, "llo "); - setComposingRegion(0, 4); - waitAndVerifyUpdateSelection(3, 1, 1, 0, 4); + mRule.setComposingRegion(0, 4); + mRule.waitAndVerifyUpdateSelection(3, 1, 1, 0, 4); - finishComposingText(); - waitAndVerifyUpdateSelection(4, 1, 1, -1, -1); + mRule.finishComposingText(); + mRule.waitAndVerifyUpdateSelection(4, 1, 1, -1, -1); - commitText("\n", 1); - waitAndVerifyUpdateSelection(5, 2, 2, -1, -1); - assertTextsAroundCursor("h\n", null, "llo "); + mRule.commitText("\n", 1); + mRule.waitAndVerifyUpdateSelection(5, 2, 2, -1, -1); + mRule.assertTextsAroundCursor("h\n", null, "llo "); } // http://crbug.com/445499 + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testDeleteText() throws Throwable { - focusElement("textarea"); + mRule.focusElement("textarea"); // The calls below are a reflection of what the stock Google Keyboard (Andr // when the noted key is touched on screen. // H - setComposingText("h", 1); - assertEquals("h", getTextBeforeCursor(9, 0)); + mRule.setComposingText("h", 1); + Assert.assertEquals("h", mRule.getTextBeforeCursor(9, 0)); // O - setComposingText("ho", 1); - assertEquals("ho", getTextBeforeCursor(9, 0)); + mRule.setComposingText("ho", 1); + Assert.assertEquals("ho", mRule.getTextBeforeCursor(9, 0)); - setComposingText("h", 1); - setComposingRegion(0, 1); - setComposingText("h", 1); - assertEquals("h", getTextBeforeCursor(9, 0)); + mRule.setComposingText("h", 1); + mRule.setComposingRegion(0, 1); + mRule.setComposingText("h", 1); + Assert.assertEquals("h", mRule.getTextBeforeCursor(9, 0)); // I - setComposingText("hi", 1); - assertEquals("hi", getTextBeforeCursor(9, 0)); + mRule.setComposingText("hi", 1); + Assert.assertEquals("hi", mRule.getTextBeforeCursor(9, 0)); // SPACE - commitText("hi", 1); - commitText(" ", 1); - assertEquals("hi ", getTextBeforeCursor(9, 0)); + mRule.commitText("hi", 1); + mRule.commitText(" ", 1); + Assert.assertEquals("hi ", mRule.getTextBeforeCursor(9, 0)); // DEL - deleteSurroundingText(1, 0); - setComposingRegion(0, 2); - assertEquals("hi", getTextBeforeCursor(9, 0)); + mRule.deleteSurroundingText(1, 0); + mRule.setComposingRegion(0, 2); + Assert.assertEquals("hi", mRule.getTextBeforeCursor(9, 0)); - setComposingText("h", 1); - assertEquals("h", getTextBeforeCursor(9, 0)); + mRule.setComposingText("h", 1); + Assert.assertEquals("h", mRule.getTextBeforeCursor(9, 0)); - commitText("", 1); - assertEquals("", getTextBeforeCursor(9, 0)); + mRule.commitText("", 1); + Assert.assertEquals("", mRule.getTextBeforeCursor(9, 0)); // DEL (on empty input) - deleteSurroundingText(1, 0); // DEL on empty still sends 1,0 - assertEquals("", getTextBeforeCursor(9, 0)); + mRule.deleteSurroundingText(1, 0); // DEL on empty still sends 1,0 + Assert.assertEquals("", mRule.getTextBeforeCursor(9, 0)); } - + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testSwipingText() throws Throwable { - focusElement("textarea"); + mRule.focusElement("textarea"); // The calls below are a reflection of what the stock Google Keyboard (Android 4.4) sends // when the word is swiped on the soft keyboard. Exercise care when altering to make sure // that the test reflects reality. If this test breaks, it's possible that code has // changed and different calls need to be made instead. // "three" - setComposingText("three", 1); - assertEquals("three", getTextBeforeCursor(99, 0)); + mRule.setComposingText("three", 1); + Assert.assertEquals("three", mRule.getTextBeforeCursor(99, 0)); // "word" - commitText("three", 1); - commitText(" ", 1); - setComposingText("word", 1); - assertEquals("three word", getTextBeforeCursor(99, 0)); + mRule.commitText("three", 1); + mRule.commitText(" ", 1); + mRule.setComposingText("word", 1); + Assert.assertEquals("three word", mRule.getTextBeforeCursor(99, 0)); // "test" - commitText("word", 1); - commitText(" ", 1); - setComposingText("test", 1); - assertEquals("three word test", getTextBeforeCursor(99, 0)); + mRule.commitText("word", 1); + mRule.commitText(" ", 1); + mRule.setComposingText("test", 1); + Assert.assertEquals("three word test", mRule.getTextBeforeCursor(99, 0)); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testDeleteMultiCharacterCodepoint() throws Throwable { // This smiley is a multi character codepoint. final String smiley = "\uD83D\uDE0A"; - commitText(smiley, 1); - waitAndVerifyUpdateSelection(0, 2, 2, -1, -1); - assertTextsAroundCursor(smiley, null, ""); + mRule.commitText(smiley, 1); + mRule.waitAndVerifyUpdateSelection(0, 2, 2, -1, -1); + mRule.assertTextsAroundCursor(smiley, null, ""); - // DEL, sent via dispatchKeyEvent like it is in Android WebView or a physical keyboard. - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); + // DEL, sent via mRule.dispatchKeyEvent like it is in Android WebView or a physical + // keyboard. + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); - waitAndVerifyUpdateSelection(1, 0, 0, -1, -1); + mRule.waitAndVerifyUpdateSelection(1, 0, 0, -1, -1); // Make sure that we accept further typing after deleting the smiley. - setComposingText("s", 1); - setComposingText("sm", 1); - waitAndVerifyUpdateSelection(2, 1, 1, 0, 1); - waitAndVerifyUpdateSelection(3, 2, 2, 0, 2); + mRule.setComposingText("s", 1); + mRule.setComposingText("sm", 1); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, 0, 1); + mRule.waitAndVerifyUpdateSelection(3, 2, 2, 0, 2); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testBackspaceKeycode() throws Throwable { - focusElement("textarea"); + mRule.focusElement("textarea"); // H - commitText("h", 1); - assertEquals("h", getTextBeforeCursor(9, 0)); + mRule.commitText("h", 1); + Assert.assertEquals("h", mRule.getTextBeforeCursor(9, 0)); // O - commitText("o", 1); - assertEquals("ho", getTextBeforeCursor(9, 0)); + mRule.commitText("o", 1); + Assert.assertEquals("ho", mRule.getTextBeforeCursor(9, 0)); - // DEL, sent via dispatchKeyEvent like it is in Android WebView or a physical keyboard. - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); + // DEL, sent via mRule.dispatchKeyEvent like it is in Android WebView or a physical + // keyboard. + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); // DEL - assertEquals("h", getTextBeforeCursor(9, 0)); + Assert.assertEquals("h", mRule.getTextBeforeCursor(9, 0)); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testRepeatBackspaceKeycode() throws Throwable { - focusElement("textarea"); + mRule.focusElement("textarea"); // H - commitText("h", 1); - assertEquals("h", getTextBeforeCursor(9, 0)); + mRule.commitText("h", 1); + Assert.assertEquals("h", mRule.getTextBeforeCursor(9, 0)); // O - commitText("o", 1); - assertEquals("ho", getTextBeforeCursor(9, 0)); + mRule.commitText("o", 1); + Assert.assertEquals("ho", mRule.getTextBeforeCursor(9, 0)); // Multiple keydowns should each delete one character (this is for physical keyboard // key-repeat). - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); // DEL - assertEquals("", getTextBeforeCursor(9, 0)); + Assert.assertEquals("", mRule.getTextBeforeCursor(9, 0)); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testPhysicalKeyboard() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); + mRule.focusElementAndWaitForStateUpdate("textarea"); // Type 'a' using a physical keyboard. - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_A)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_A)); - waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_A)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_A)); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); // Type 'enter' key. - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); - assertTextsAroundCursor("a\n", null, "\n"); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.assertTextsAroundCursor("a\n", null, "\n"); // Type 'b'. - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_B)); - waitAndVerifyUpdateSelection(2, 3, 3, -1, -1); - assertTextsAroundCursor("a\nb", null, ""); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_B)); + mRule.waitAndVerifyUpdateSelection(2, 3, 3, -1, -1); + mRule.assertTextsAroundCursor("a\nb", null, ""); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testPhysicalKeyboard_AccentKeyCodes() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); + mRule.focusElementAndWaitForStateUpdate("textarea"); // h - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_H)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_H)); - assertEquals("h", getTextBeforeCursor(9, 0)); - waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_H)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_H)); + Assert.assertEquals("h", mRule.getTextBeforeCursor(9, 0)); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); // ALT-i (circumflex accent key on virtual keyboard) - dispatchKeyEvent(new KeyEvent( + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - assertEquals("hˆ", getTextBeforeCursor(9, 0)); - dispatchKeyEvent(new KeyEvent( + Assert.assertEquals("hˆ", mRule.getTextBeforeCursor(9, 0)); + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - assertEquals("hˆ", getTextBeforeCursor(9, 0)); - waitAndVerifyUpdateSelection(1, 2, 2, 1, 2); + Assert.assertEquals("hˆ", mRule.getTextBeforeCursor(9, 0)); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, 1, 2); // o - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_O)); - assertEquals("hô", getTextBeforeCursor(9, 0)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_O)); - assertEquals("hô", getTextBeforeCursor(9, 0)); - waitAndVerifyUpdateSelection(2, 2, 2, -1, -1); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_O)); + Assert.assertEquals("hô", mRule.getTextBeforeCursor(9, 0)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_O)); + Assert.assertEquals("hô", mRule.getTextBeforeCursor(9, 0)); + mRule.waitAndVerifyUpdateSelection(2, 2, 2, -1, -1); // ALT-i - dispatchKeyEvent(new KeyEvent( + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - dispatchKeyEvent(new KeyEvent( + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - assertEquals("hôˆ", getTextBeforeCursor(9, 0)); - waitAndVerifyUpdateSelection(3, 3, 3, 2, 3); + Assert.assertEquals("hôˆ", mRule.getTextBeforeCursor(9, 0)); + mRule.waitAndVerifyUpdateSelection(3, 3, 3, 2, 3); // ALT-i again should have no effect - dispatchKeyEvent(new KeyEvent( + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - dispatchKeyEvent(new KeyEvent( + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - assertEquals("hôˆ", getTextBeforeCursor(9, 0)); + Assert.assertEquals("hôˆ", mRule.getTextBeforeCursor(9, 0)); // b (cannot be accented, should just appear after) - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B)); - assertEquals("hôˆb", getTextBeforeCursor(9, 0)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_B)); - assertEquals("hôˆb", getTextBeforeCursor(9, 0)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B)); + Assert.assertEquals("hôˆb", mRule.getTextBeforeCursor(9, 0)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_B)); + Assert.assertEquals("hôˆb", mRule.getTextBeforeCursor(9, 0)); int index = 4; - waitAndVerifyUpdateSelection(index++, 4, 4, -1, -1); + mRule.waitAndVerifyUpdateSelection(index++, 4, 4, -1, -1); // ALT-i - dispatchKeyEvent(new KeyEvent( + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - dispatchKeyEvent(new KeyEvent( + mRule.dispatchKeyEvent(new KeyEvent( 0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_I, 0, KeyEvent.META_ALT_ON)); - assertEquals("hôˆbˆ", getTextBeforeCursor(9, 0)); - waitAndVerifyUpdateSelection(index++, 5, 5, 4, 5); + Assert.assertEquals("hôˆbˆ", mRule.getTextBeforeCursor(9, 0)); + mRule.waitAndVerifyUpdateSelection(index++, 5, 5, 4, 5); // Backspace - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); - assertEquals("hôˆb", getTextBeforeCursor(9, 0)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); - assertEquals("hôˆb", getTextBeforeCursor(9, 0)); - waitAndVerifyUpdateSelection(index++, 4, 4, -1, -1); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); + Assert.assertEquals("hôˆb", mRule.getTextBeforeCursor(9, 0)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); + Assert.assertEquals("hôˆb", mRule.getTextBeforeCursor(9, 0)); + mRule.waitAndVerifyUpdateSelection(index++, 4, 4, -1, -1); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testSetComposingRegionOutOfBounds() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); - setComposingText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); + mRule.focusElementAndWaitForStateUpdate("textarea"); + mRule.setComposingText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); - setComposingRegion(0, 0); - waitAndVerifyUpdateSelection(1, 5, 5, -1, -1); - setComposingRegion(0, 9); - waitAndVerifyUpdateSelection(2, 5, 5, 0, 5); - setComposingRegion(9, 1); - waitAndVerifyUpdateSelection(3, 5, 5, 1, 5); + mRule.setComposingRegion(0, 0); + mRule.waitAndVerifyUpdateSelection(1, 5, 5, -1, -1); + mRule.setComposingRegion(0, 9); + mRule.waitAndVerifyUpdateSelection(2, 5, 5, 0, 5); + mRule.setComposingRegion(9, 1); + mRule.waitAndVerifyUpdateSelection(3, 5, 5, 1, 5); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testEnterKey_AfterCommitText() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); + mRule.focusElementAndWaitForStateUpdate("textarea"); - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)); - waitAndVerifyUpdateSelection(1, 6, 6, -1, -1); - assertTextsAroundCursor("hello\n", null, "\n"); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)); + mRule.waitAndVerifyUpdateSelection(1, 6, 6, -1, -1); + mRule.assertTextsAroundCursor("hello\n", null, "\n"); - commitText("world", 1); - waitAndVerifyUpdateSelection(2, 11, 11, -1, -1); - assertTextsAroundCursor("hello\nworld", null, ""); + mRule.commitText("world", 1); + mRule.waitAndVerifyUpdateSelection(2, 11, 11, -1, -1); + mRule.assertTextsAroundCursor("hello\nworld", null, ""); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testEnterKey_WhileComposingText() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); + mRule.focusElementAndWaitForStateUpdate("textarea"); - setComposingText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); + mRule.setComposingText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, 0, 5); // IME app should call this, otherwise enter key should clear the current composition. - finishComposingText(); - waitAndVerifyUpdateSelection(1, 5, 5, -1, -1); + mRule.finishComposingText(); + mRule.waitAndVerifyUpdateSelection(1, 5, 5, -1, -1); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)); // The second new line is not a user visible/editable one, it is a side-effect of Blink // using <br> internally. This only happens when \n is at the end. - waitAndVerifyUpdateSelection(2, 6, 6, -1, -1); + mRule.waitAndVerifyUpdateSelection(2, 6, 6, -1, -1); - commitText("world", 1); - waitAndVerifyUpdateSelection(3, 11, 11, -1, -1); - assertTextsAroundCursor("hello\nworld", null, ""); + mRule.commitText("world", 1); + mRule.waitAndVerifyUpdateSelection(3, 11, 11, -1, -1); + mRule.assertTextsAroundCursor("hello\nworld", null, ""); } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testDpadKeyCodesWhileSwipingText() throws Throwable { - focusElement("textarea"); + mRule.focusElement("textarea"); // DPAD_CENTER should cause keyboard to appear - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_CENTER)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_CENTER)); // TODO(changwan): should really check this. } + @Test @SmallTest @Feature({"TextInput", "Main"}) public void testNavigateTextWithDpadKeyCodes() throws Throwable { - focusElementAndWaitForStateUpdate("textarea"); + mRule.focusElementAndWaitForStateUpdate("textarea"); - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT)); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DPAD_LEFT)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT)); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DPAD_LEFT)); - assertTextsAroundCursor("hell", null, "o"); + mRule.assertTextsAroundCursor("hell", null, "o"); } + @Test @SmallTest @Feature({"TextInput"}) public void testPastePopupShowAndHide() throws Throwable { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - selectAll(); - waitAndVerifyUpdateSelection(1, 0, 5, -1, -1); - assertTextsAroundCursor("", "hello", ""); + mRule.selectAll(); + mRule.waitAndVerifyUpdateSelection(1, 0, 5, -1, -1); + mRule.assertTextsAroundCursor("", "hello", ""); - cut(); - waitAndVerifyUpdateSelection(2, 0, 0, -1, -1); - assertTextsAroundCursor("", null, ""); + mRule.cut(); + mRule.waitAndVerifyUpdateSelection(2, 0, 0, -1, -1); + mRule.assertTextsAroundCursor("", null, ""); - DOMUtils.longPressNode(mContentViewCore, "input_text"); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { - return mSelectionPopupController.isPastePopupShowing() - && mSelectionPopupController.isInsertion(); + return mRule.getSelectionPopupController().isPastePopupShowing() + && mRule.getSelectionPopupController().isInsertion(); } }); - setComposingText("h", 1); + mRule.setComposingText("h", 1); CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { - return !mSelectionPopupController.isPastePopupShowing(); + return !mRule.getSelectionPopupController().isPastePopupShowing(); } }); - assertFalse(mSelectionPopupController.isInsertion()); + Assert.assertFalse(mRule.getSelectionPopupController().isInsertion()); } + @Test @SmallTest @Feature({"TextInput"}) public void testSelectionClearedOnKeyEvent() throws Throwable { - commitText("Sample Text", 1); - waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); + mRule.commitText("Sample Text", 1); + mRule.waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); - DOMUtils.longPressNode(mContentViewCore, "input_text"); - assertWaitForSelectActionBarStatus(true); + DOMUtils.longPressNode(mRule.getContentViewCore(), "input_text"); + mRule.assertWaitForSelectActionBarStatus(true); - setComposingText("h", 1); - assertWaitForSelectActionBarStatus(false); - assertFalse(mSelectionPopupController.hasSelection()); + mRule.setComposingText("h", 1); + mRule.assertWaitForSelectActionBarStatus(false); + Assert.assertFalse(mRule.getSelectionPopupController().hasSelection()); } + @Test @SmallTest @Feature({"TextInput"}) public void testTextHandlesPreservedWithDpadNavigation() throws Throwable { - DOMUtils.longPressNode(mContentViewCore, "plain_text"); - assertWaitForSelectActionBarStatus(true); - assertTrue(mSelectionPopupController.hasSelection()); + DOMUtils.longPressNode(mRule.getContentViewCore(), "plain_text"); + mRule.assertWaitForSelectActionBarStatus(true); + Assert.assertTrue(mRule.getSelectionPopupController().hasSelection()); - dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_DOWN)); - assertWaitForSelectActionBarStatus(true); - assertTrue(mSelectionPopupController.hasSelection()); + mRule.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_DOWN)); + mRule.assertWaitForSelectActionBarStatus(true); + Assert.assertTrue(mRule.getSelectionPopupController().hasSelection()); } + @Test @MediumTest @Feature({"TextInput"}) public void testRestartInputWhileComposingText() throws Throwable { - setComposingText("abc", 1); - waitAndVerifyUpdateSelection(0, 3, 3, 0, 3); - restartInput(); + mRule.setComposingText("abc", 1); + mRule.waitAndVerifyUpdateSelection(0, 3, 3, 0, 3); + mRule.restartInput(); // We don't do anything when input gets restarted. But we depend on Android's - // InputMethodManager and/or input methods to call finishComposingText() in setting + // InputMethodManager and/or input methods to call mRule.finishComposingText() in setting // current input connection as active or finishing the current input connection. Thread.sleep(1000); - assertEquals(1, mInputMethodManagerWrapper.getUpdateSelectionList().size()); + Assert.assertEquals( + 1, mRule.getInputMethodManagerWrapper().getUpdateSelectionList().size()); } + @Test @MediumTest @Feature({"TextInput"}) public void testRestartInputKeepsTextAndCursor() throws Exception { - commitText("ab", 2); - restartInput(); - assertEquals("ab", getTextBeforeCursor(10, 0)); + mRule.commitText("ab", 2); + mRule.restartInput(); + Assert.assertEquals("ab", mRule.getTextBeforeCursor(10, 0)); } + @Test @MediumTest @Feature({"TextInput"}) public void testContentEditableEvents_ComposingText() throws Throwable { - focusElementAndWaitForStateUpdate("contenteditable_event"); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.focusElementAndWaitForStateUpdate("contenteditable_event"); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - setComposingText("a", 1); - waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); + mRule.setComposingText("a", 1); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); // TODO(changwan): reduce the number of selection changes. - waitForEventLogs("keydown(229),compositionstart(),compositionupdate(a),input,keyup(229)," + mRule.waitForEventLogs( + "keydown(229),compositionstart(),compositionupdate(a),input,keyup(229)," + "selectionchange,selectionchange"); - clearEventLogs(); + mRule.clearEventLogs(); - finishComposingText(); - waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); - waitForEventLogs( - "compositionend(a)"); + mRule.finishComposingText(); + mRule.waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); + mRule.waitForEventLogs("compositionend(a)"); } + @Test @MediumTest @Feature({"TextInput"}) public void testInputTextEvents_ComposingText() throws Throwable { - setComposingText("a", 1); - waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); + mRule.setComposingText("a", 1); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, 0, 1); // TODO(changwan): reduce the number of selection changes. - waitForEventLogs("keydown(229),compositionstart(),compositionupdate(a)," + mRule.waitForEventLogs("keydown(229),compositionstart(),compositionupdate(a)," + "input,keyup(229),selectionchange,selectionchange"); - clearEventLogs(); + mRule.clearEventLogs(); - finishComposingText(); - waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); - waitForEventLogs("compositionend(a)"); + mRule.finishComposingText(); + mRule.waitAndVerifyUpdateSelection(1, 1, 1, -1, -1); + mRule.waitForEventLogs("compositionend(a)"); } + @Test @MediumTest @Feature({"TextInput"}) public void testContentEditableEvents_CommitText() throws Throwable { - focusElementAndWaitForStateUpdate("contenteditable_event"); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.focusElementAndWaitForStateUpdate("contenteditable_event"); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - commitText("a", 1); - waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); + mRule.commitText("a", 1); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); - waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); + mRule.waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); } + @Test @MediumTest @Feature({"TextInput"}) public void testInputTextEvents_CommitText() throws Throwable { - commitText("a", 1); - waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); + mRule.commitText("a", 1); + mRule.waitAndVerifyUpdateSelection(0, 1, 1, -1, -1); - waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); + mRule.waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); } + @Test @MediumTest @Feature({"TextInput"}) public void testContentEditableEvents_DeleteSurroundingText() throws Throwable { - focusElementAndWaitForStateUpdate("contenteditable_event"); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.focusElementAndWaitForStateUpdate("contenteditable_event"); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); - clearEventLogs(); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); + mRule.clearEventLogs(); - setSelection(2, 2); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.setSelection(2, 2); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - deleteSurroundingText(1, 1); - waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + mRule.deleteSurroundingText(1, 1); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + // TODO(yabinh): It should only fire 1 input and 1 selectionchange events. - waitForEventLogs("keydown(229),input,input,keyup(229),selectionchange,selectionchange"); + mRule.waitForEventLogs( + "keydown(229),input,input,keyup(229),selectionchange,selectionchange"); } + @Test @MediumTest @Feature({"TextInput"}) public void testInputTextEvents_DeleteSurroundingText() throws Throwable { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); - clearEventLogs(); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); + mRule.clearEventLogs(); - setSelection(2, 2); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.setSelection(2, 2); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - deleteSurroundingText(1, 1); - waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + mRule.deleteSurroundingText(1, 1); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); // TODO(yabinh): It should only fire 1 input and 1 selectionchange events. - waitForEventLogs("keydown(229),input,input,keyup(229),selectionchange,selectionchange"); + mRule.waitForEventLogs( + "keydown(229),input,input,keyup(229),selectionchange,selectionchange"); } + @Test @MediumTest @Feature({"TextInput"}) public void testContentEditableEvents_DeleteSurroundingTextInCodePoints() throws Throwable { - focusElementAndWaitForStateUpdate("contenteditable_event"); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.focusElementAndWaitForStateUpdate("contenteditable_event"); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); - clearEventLogs(); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); + mRule.clearEventLogs(); - setSelection(2, 2); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.setSelection(2, 2); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - deleteSurroundingTextInCodePoints(1, 1); - waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + mRule.deleteSurroundingTextInCodePoints(1, 1); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); // TODO(yabinh): It should only fire 1 input and 1 selectionchange events. - waitForEventLogs("keydown(229),input,input,keyup(229),selectionchange,selectionchange"); + mRule.waitForEventLogs( + "keydown(229),input,input,keyup(229),selectionchange,selectionchange"); } + @Test @MediumTest @Feature({"TextInput"}) public void testInputTextEvents_DeleteSurroundingTextInCodePoints() throws Throwable { - commitText("hello", 1); - waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); - waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); - clearEventLogs(); + mRule.commitText("hello", 1); + mRule.waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); + mRule.waitForEventLogs("keydown(229),input,keyup(229),selectionchange"); + mRule.clearEventLogs(); - setSelection(2, 2); - waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); - waitForEventLogs("selectionchange"); - clearEventLogs(); + mRule.setSelection(2, 2); + mRule.waitAndVerifyUpdateSelection(1, 2, 2, -1, -1); + mRule.waitForEventLogs("selectionchange"); + mRule.clearEventLogs(); - deleteSurroundingTextInCodePoints(1, 1); - waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); + mRule.deleteSurroundingTextInCodePoints(1, 1); + mRule.waitAndVerifyUpdateSelection(2, 1, 1, -1, -1); // TODO(yabinh): It should only fire 1 input and 1 selectionchange events. - waitForEventLogs("keydown(229),input,input,keyup(229),selectionchange,selectionchange"); + mRule.waitForEventLogs( + "keydown(229),input,input,keyup(229),selectionchange,selectionchange"); } + @Test @MediumTest @Feature({"TextInput"}) public void testGetCursorCapsMode() throws Throwable { - focusElementAndWaitForStateUpdate("contenteditable_event"); - commitText("Hello World", 1); - waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); - assertEquals(0, - getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS)); - setSelection(6, 6); - waitAndVerifyUpdateSelection(1, 6, 6, -1, -1); - assertEquals(InputType.TYPE_TEXT_FLAG_CAP_WORDS, - getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS)); - commitText("\n", 1); - assertEquals(InputType.TYPE_TEXT_FLAG_CAP_WORDS, - getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS)); - } - - private void clearEventLogs() throws Exception { - final String code = "clearEventLogs()"; - JavaScriptUtils.executeJavaScriptAndWaitForResult( - getContentViewCore().getWebContents(), code); - } - - private void waitForEventLogs(String expectedLogs) throws Exception { - final String code = "getEventLogs()"; - final String sanitizedExpectedLogs = "\"" + expectedLogs + "\""; - assertEquals(sanitizedExpectedLogs, JavaScriptUtils.executeJavaScriptAndWaitForResult( - getContentViewCore().getWebContents(), code)); + mRule.focusElementAndWaitForStateUpdate("contenteditable_event"); + mRule.commitText("Hello World", 1); + mRule.waitAndVerifyUpdateSelection(0, 11, 11, -1, -1); + Assert.assertEquals(0, mRule.getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS)); + mRule.setSelection(6, 6); + mRule.waitAndVerifyUpdateSelection(1, 6, 6, -1, -1); + Assert.assertEquals(InputType.TYPE_TEXT_FLAG_CAP_WORDS, + mRule.getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS)); + mRule.commitText("\n", 1); + Assert.assertEquals(InputType.TYPE_TEXT_FLAG_CAP_WORDS, + mRule.getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS)); } // https://crbug.com/604675 + @Test @MediumTest @Feature({"TextInput"}) public void testAlertInKeyUpListenerDoesNotCrash() throws Exception { @@ -1495,19 +1424,20 @@ + "editor.addEventListener('keyup', function(e) { alert('keyup') });" + "})();"; JavaScriptUtils.executeJavaScriptAndWaitForResult( - getContentViewCore().getWebContents(), code); - setComposingText("ab", 1); - finishComposingText(); - assertEquals("ab", getTextBeforeCursor(10, 0)); + mRule.getContentViewCore().getWebContents(), code); + mRule.setComposingText("ab", 1); + mRule.finishComposingText(); + Assert.assertEquals("ab", mRule.getTextBeforeCursor(10, 0)); } // https://crbug.com/616334 + @Test @SmallTest @Feature({"TextInput"}) public void testCastToBaseInputConnection() throws Exception { - commitText("a", 1); - final BaseInputConnection baseInputConnection = (BaseInputConnection) mConnection; - assertEquals("a", runBlockingOnImeThread(new Callable<CharSequence>() { + mRule.commitText("a", 1); + final BaseInputConnection baseInputConnection = (BaseInputConnection) mRule.getConnection(); + Assert.assertEquals("a", mRule.runBlockingOnImeThread(new Callable<CharSequence>() { @Override public CharSequence call() { return baseInputConnection.getTextBeforeCursor(10, 0); @@ -1517,11 +1447,12 @@ // Tests that the method call order is kept. // See crbug.com/601707 for details. + @Test @MediumTest @Feature({"TextInput"}) public void testSetSelectionCommitTextOrder() throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - runBlockingOnImeThread(new Callable<Void>() { + final ChromiumBaseInputConnection connection = mRule.getConnection(); + mRule.runBlockingOnImeThread(new Callable<Void>() { @Override public Void call() { connection.beginBatchEdit(); @@ -1536,26 +1467,27 @@ return null; } }); - waitAndVerifyUpdateSelection(0, 7, 7, -1, -1); + mRule.waitAndVerifyUpdateSelection(0, 7, 7, -1, -1); } // crbug.com/643477 + @Test @MediumTest @Feature({"TextInput"}) public void testUiThreadAccess() throws Exception { - final ChromiumBaseInputConnection connection = mConnection; + final ChromiumBaseInputConnection connection = mRule.getConnection(); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { // We allow UI thread access for most functions, except for // beginBatchEdit(), endBatchEdit(), and get* methods(). - assertTrue(connection.commitText("a", 1)); - assertTrue(connection.setComposingText("b", 1)); - assertTrue(connection.setComposingText("bc", 1)); - assertTrue(connection.finishComposingText()); + Assert.assertTrue(connection.commitText("a", 1)); + Assert.assertTrue(connection.setComposingText("b", 1)); + Assert.assertTrue(connection.setComposingText("bc", 1)); + Assert.assertTrue(connection.finishComposingText()); } }); - assertEquals("abc", runBlockingOnImeThread(new Callable<CharSequence>() { + Assert.assertEquals("abc", mRule.runBlockingOnImeThread(new Callable<CharSequence>() { @Override public CharSequence call() throws Exception { return connection.getTextBeforeCursor(5, 0); @@ -1563,424 +1495,4 @@ })); } - private void performGo(TestCallbackHelperContainer testCallbackHelperContainer) - throws Throwable { - final InputConnection inputConnection = mConnection; - final Callable<Void> callable = new Callable<Void>() { - @Override - public Void call() throws Exception { - inputConnection.performEditorAction(EditorInfo.IME_ACTION_GO); - return null; - } - }; - - handleBlockingCallbackAction( - testCallbackHelperContainer.getOnPageFinishedHelper(), - new Runnable() { - @Override - public void run() { - try { - runBlockingOnImeThread(callable); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - } - }); - } - - private void assertWaitForKeyboardStatus(final boolean show) { - CriteriaHelper.pollUiThread(new Criteria() { - @Override - public boolean isSatisfied() { - // We do not check the other way around: in some cases we need to keep - // input connection even when the last known status is 'hidden'. - if (show && getInputConnection() == null) { - updateFailureReason("input connection should not be null."); - return false; - } - updateFailureReason("expected show: " + show); - return show == mInputMethodManagerWrapper.isShowWithoutHideOutstanding(); - } - }); - } - - private void assertWaitForSelectActionBarStatus(final boolean show) { - CriteriaHelper.pollUiThread(Criteria.equals(show, new Callable<Boolean>() { - @Override - public Boolean call() { - return mContentViewCore.isSelectActionBarShowing(); - } - })); - } - - private void waitAndVerifyUpdateSelection(final int index, final int selectionStart, - final int selectionEnd, final int compositionStart, final int compositionEnd) { - final List<Pair<Range, Range>> states = mInputMethodManagerWrapper.getUpdateSelectionList(); - CriteriaHelper.pollUiThread(new Criteria() { - @Override - public boolean isSatisfied() { - return states.size() > index; - } - }); - Pair<Range, Range> selection = states.get(index); - assertEquals(selectionStart, selection.first.start()); - assertEquals(selectionEnd, selection.first.end()); - assertEquals(compositionStart, selection.second.start()); - assertEquals(compositionEnd, selection.second.end()); - } - - private void resetUpdateSelectionList() { - mInputMethodManagerWrapper.getUpdateSelectionList().clear(); - } - - private void assertClipboardContents(final Activity activity, final String expectedContents) { - CriteriaHelper.pollUiThread(new Criteria() { - @Override - public boolean isSatisfied() { - ClipboardManager clipboardManager = - (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); - ClipData clip = clipboardManager.getPrimaryClip(); - return clip != null && clip.getItemCount() == 1 - && TextUtils.equals(clip.getItemAt(0).getText(), expectedContents); - } - }); - } - - private ImeAdapter getImeAdapter() { - return mContentViewCore.getImeAdapterForTest(); - } - - private ChromiumBaseInputConnection getInputConnection() { - try { - return ThreadUtils.runOnUiThreadBlocking(new Callable<ChromiumBaseInputConnection>() { - @Override - public ChromiumBaseInputConnection call() { - return mContentViewCore.getImeAdapterForTest().getInputConnectionForTest(); - } - }); - } catch (ExecutionException e) { - e.printStackTrace(); - fail(); - return null; - } - } - - private void restartInput() { - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - mImeAdapter.restartInput(); - } - }); - } - - // After calling this method, we should call assertClipboardContents() to wait for the clipboard - // to get updated. See cubug.com/621046 - private void copy() { - final WebContents webContents = mWebContents; - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - webContents.copy(); - } - }); - } - - private void cut() { - final WebContents webContents = mWebContents; - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - webContents.cut(); - } - }); - } - - private void setClip(final CharSequence text) { - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - final ClipboardManager clipboardManager = - (ClipboardManager) getActivity().getSystemService( - Context.CLIPBOARD_SERVICE); - clipboardManager.setPrimaryClip(ClipData.newPlainText(null, text)); - } - }); - } - - private void paste() { - final WebContents webContents = mWebContents; - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - webContents.paste(); - } - }); - } - - private void selectAll() { - final WebContents webContents = mWebContents; - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - webContents.selectAll(); - } - }); - } - - private void collapseSelection() { - final WebContents webContents = mWebContents; - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - webContents.collapseSelection(); - } - }); - } - - /** - * Run the {@Callable} on IME thread (or UI thread if not applicable). - * @param c The callable - * @return The result from running the callable. - */ - protected <T> T runBlockingOnImeThread(Callable<T> c) throws Exception { - return ImeTestUtils.runBlockingOnHandler(mConnectionFactory.getHandler(), c); - } - - private boolean beginBatchEdit() throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.beginBatchEdit(); - } - }); - } - - private boolean endBatchEdit() throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.endBatchEdit(); - } - }); - } - - private boolean commitText(final CharSequence text, final int newCursorPosition) - throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.commitText(text, newCursorPosition); - } - }); - } - - private boolean setSelection(final int start, final int end) throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.setSelection(start, end); - } - }); - } - - private boolean setComposingRegion(final int start, final int end) throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.setComposingRegion(start, end); - } - }); - } - - protected boolean setComposingText(final CharSequence text, final int newCursorPosition) - throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.setComposingText(text, newCursorPosition); - } - }); - } - - private boolean finishComposingText() throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.finishComposingText(); - } - }); - } - - private boolean deleteSurroundingText(final int before, final int after) throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.deleteSurroundingText(before, after); - } - }); - } - - // Note that deleteSurroundingTextInCodePoints() was introduced in Android N (Api level 24), but - // the Android repository used in Chrome is behind that (level 23). So this function can't be - // called by keyboard apps currently. - @TargetApi(24) - private boolean deleteSurroundingTextInCodePoints(final int before, final int after) - throws Exception { - final ThreadedInputConnection connection = (ThreadedInputConnection) mConnection; - return runBlockingOnImeThread(new Callable<Boolean>() { - @Override - public Boolean call() { - return connection.deleteSurroundingTextInCodePoints(before, after); - } - }); - } - - private CharSequence getTextBeforeCursor(final int length, final int flags) throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<CharSequence>() { - @Override - public CharSequence call() { - return connection.getTextBeforeCursor(length, flags); - } - }); - } - - private CharSequence getSelectedText(final int flags) throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<CharSequence>() { - @Override - public CharSequence call() { - return connection.getSelectedText(flags); - } - }); - } - - private CharSequence getTextAfterCursor(final int length, final int flags) throws Exception { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<CharSequence>() { - @Override - public CharSequence call() { - return connection.getTextAfterCursor(length, flags); - } - }); - } - - private int getCursorCapsMode(final int reqModes) throws Throwable { - final ChromiumBaseInputConnection connection = mConnection; - return runBlockingOnImeThread(new Callable<Integer>() { - @Override - public Integer call() { - return connection.getCursorCapsMode(reqModes); - } - }); - } - - private void dispatchKeyEvent(final KeyEvent event) { - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - mImeAdapter.dispatchKeyEvent(event); - } - }); - } - - /** - * Focus element, wait for a single state update, reset state update list. - * @param id ID of the element to focus. - */ - private void focusElementAndWaitForStateUpdate(String id) - throws InterruptedException, TimeoutException { - resetUpdateSelectionList(); - focusElement(id); - waitAndVerifyUpdateSelection(0, 0, 0, -1, -1); - resetUpdateSelectionList(); - } - - private void focusElement(final String id) throws InterruptedException, TimeoutException { - focusElement(id, true); - } - - private void focusElement(final String id, boolean shouldShowKeyboard) - throws InterruptedException, TimeoutException { - DOMUtils.focusNode(mWebContents, id); - assertWaitForKeyboardStatus(shouldShowKeyboard); - CriteriaHelper.pollInstrumentationThread(Criteria.equals(id, new Callable<String>() { - @Override - public String call() throws Exception { - return DOMUtils.getFocusedNode(mWebContents); - } - })); - // When we focus another element, the connection may be recreated. - mConnection = getInputConnection(); - } - - private static class TestInputConnectionFactory implements ChromiumBaseInputConnection.Factory { - private final ChromiumBaseInputConnection.Factory mFactory; - - private final List<Integer> mTextInputTypeList = new ArrayList<>(); - private EditorInfo mOutAttrs; - - public TestInputConnectionFactory(ChromiumBaseInputConnection.Factory factory) { - mFactory = factory; - } - - @Override - public ChromiumBaseInputConnection initializeAndGet(View view, ImeAdapter imeAdapter, - int inputType, int inputFlags, int inputMode, int selectionStart, int selectionEnd, - EditorInfo outAttrs) { - mTextInputTypeList.add(inputType); - mOutAttrs = outAttrs; - return mFactory.initializeAndGet(view, imeAdapter, inputType, inputMode, inputFlags, - selectionStart, selectionEnd, outAttrs); - } - - @Override - public Handler getHandler() { - return mFactory.getHandler(); - } - - public Integer[] getTextInputTypeHistory() { - Integer[] result = new Integer[mTextInputTypeList.size()]; - mTextInputTypeList.toArray(result); - return result; - } - - public void clearTextInputTypeHistory() { - mTextInputTypeList.clear(); - } - - public EditorInfo getOutAttrs() { - return mOutAttrs; - } - - @Override - public void onWindowFocusChanged(boolean gainFocus) { - mFactory.onWindowFocusChanged(gainFocus); - } - - @Override - public void onViewFocusChanged(boolean gainFocus) { - mFactory.onViewFocusChanged(gainFocus); - } - - @Override - public void onViewAttachedToWindow() { - mFactory.onViewAttachedToWindow(); - } - - @Override - public void onViewDetachedFromWindow() { - mFactory.onViewDetachedFromWindow(); - } - } }
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index acda0d6..d553b2a9 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -222,6 +222,8 @@ "service_info.cc", "service_info.h", "service_manager_connection.h", + "simple_connection_filter.cc", + "simple_connection_filter.h", "speech_recognition_error.h", "speech_recognition_grammar.h", "speech_recognition_result.cc",
diff --git a/content/public/common/simple_connection_filter.cc b/content/public/common/simple_connection_filter.cc new file mode 100644 index 0000000..9b321750 --- /dev/null +++ b/content/public/common/simple_connection_filter.cc
@@ -0,0 +1,29 @@ +// Copyright 2017 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 "content/public/common/simple_connection_filter.h" + +#include "services/service_manager/public/cpp/binder_registry.h" +#include "services/service_manager/public/cpp/service_info.h" + +namespace content { + +SimpleConnectionFilter::SimpleConnectionFilter( + std::unique_ptr<service_manager::BinderRegistry> registry) + : registry_(std::move(registry)) {} + +SimpleConnectionFilter::~SimpleConnectionFilter() {} + +void SimpleConnectionFilter::OnBindInterface( + const service_manager::ServiceInfo& source_info, + const std::string& interface_name, + mojo::ScopedMessagePipeHandle* interface_pipe, + service_manager::Connector* connector) { + if (registry_->CanBindInterface(interface_name)) { + registry_->BindInterface(source_info.identity, interface_name, + std::move(*interface_pipe)); + } +} + +} // namespace content
diff --git a/content/public/common/simple_connection_filter.h b/content/public/common/simple_connection_filter.h new file mode 100644 index 0000000..3ef4f63 --- /dev/null +++ b/content/public/common/simple_connection_filter.h
@@ -0,0 +1,40 @@ +// Copyright 2017 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 CONTENT_PUBLIC_COMMON_SIMPLE_CONNECTION_FILTER_H_ +#define CONTENT_PUBLIC_COMMON_SIMPLE_CONNECTION_FILTER_H_ + +#include <memory> +#include <string> + +#include "content/common/content_export.h" +#include "content/public/common/connection_filter.h" + +namespace service_manager { +class BinderRegistry; +} + +namespace content { + +class CONTENT_EXPORT SimpleConnectionFilter : public ConnectionFilter { + public: + explicit SimpleConnectionFilter( + std::unique_ptr<service_manager::BinderRegistry> registry); + ~SimpleConnectionFilter() override; + + // ConnectionFilter: + void OnBindInterface(const service_manager::ServiceInfo& source_info, + const std::string& interface_name, + mojo::ScopedMessagePipeHandle* interface_pipe, + service_manager::Connector* connector) override; + + private: + std::unique_ptr<service_manager::BinderRegistry> registry_; + + DISALLOW_COPY_AND_ASSIGN(SimpleConnectionFilter); +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_SIMPLE_CONNECTION_FILTER_H_
diff --git a/content/public/test/android/BUILD.gn b/content/public/test/android/BUILD.gn index df0241a..478a8fa 100644 --- a/content/public/test/android/BUILD.gn +++ b/content/public/test/android/BUILD.gn
@@ -32,6 +32,7 @@ "javatests/src/org/chromium/content/browser/test/ChildProcessAllocatorSettings.java", "javatests/src/org/chromium/content/browser/test/ChildProcessAllocatorSettingsHook.java", "javatests/src/org/chromium/content/browser/test/ContentInstrumentationTestRunner.java", + "javatests/src/org/chromium/content/browser/test/ContentJUnit4ClassRunner.java", "javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java", "javatests/src/org/chromium/content/browser/test/NativeLibraryTestCommon.java", "javatests/src/org/chromium/content/browser/test/NativeLibraryTestRule.java",
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/ChildProcessAllocatorSettingsHook.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/ChildProcessAllocatorSettingsHook.java index ab42403..c0976f6 100644 --- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/ChildProcessAllocatorSettingsHook.java +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/ChildProcessAllocatorSettingsHook.java
@@ -11,14 +11,18 @@ import java.lang.reflect.Method; -/** PreTestHook used to register the ChildProcessAllocatorSettings annotation. */ +/** + * PreTestHook used to register the ChildProcessAllocatorSettings annotation. + * + * TODO(yolandyan): convert this to TestRule once content tests are changed JUnit4 + * */ public final class ChildProcessAllocatorSettingsHook implements PreTestHook { @Override public void run(Context targetContext, Method testMethod) { ChildProcessAllocatorSettings annotation = testMethod.getAnnotation(ChildProcessAllocatorSettings.class); if (annotation != null) { - ChildConnectionAllocator.setSanboxServicesSettingsForTesting( + ChildConnectionAllocator.setSandboxServicesSettingsForTesting( annotation.sandboxedServiceCount(), annotation.sandboxedServiceName()); } }
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/ContentJUnit4ClassRunner.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/ContentJUnit4ClassRunner.java new file mode 100644 index 0000000..8581532 --- /dev/null +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/ContentJUnit4ClassRunner.java
@@ -0,0 +1,37 @@ +// Copyright 2017 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. + +package org.chromium.content.browser.test; + +import org.junit.runners.model.InitializationError; + +import org.chromium.base.test.BaseJUnit4ClassRunner; +import org.chromium.base.test.BaseTestResult.PreTestHook; +import org.chromium.base.test.util.CommandLineFlags; + +import java.util.Arrays; +import java.util.List; + +/** + * A custom runner for //content JUnit4 tests. + */ +public class ContentJUnit4ClassRunner extends BaseJUnit4ClassRunner { + /** + * Create a ContentJUnit4ClassRunner to run {@code klass} and initialize values + * + * @throws InitializationError if the test class malformed + */ + public ContentJUnit4ClassRunner(final Class<?> klass) throws InitializationError { + super(klass, null, defaultPreTestHooks()); + } + + /** + * Change this static function to add default {@code PreTestHook}s. + */ + private static List<PreTestHook> defaultPreTestHooks() { + return Arrays.asList(new PreTestHook[] { + CommandLineFlags.getRegistrationHook(), + new ChildProcessAllocatorSettingsHook()}); + } +}
diff --git a/content/renderer/media/gpu/rtc_video_decoder.cc b/content/renderer/media/gpu/rtc_video_decoder.cc index 9a44d326..e373f2f 100644 --- a/content/renderer/media/gpu/rtc_video_decoder.cc +++ b/content/renderer/media/gpu/rtc_video_decoder.cc
@@ -305,14 +305,13 @@ return WEBRTC_VIDEO_CODEC_OK; } -void RTCVideoDecoder::ProvidePictureBuffers(uint32_t count, +void RTCVideoDecoder::ProvidePictureBuffers(uint32_t buffer_count, media::VideoPixelFormat format, uint32_t textures_per_buffer, const gfx::Size& size, uint32_t texture_target) { DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); DVLOG(3) << "ProvidePictureBuffers. texture_target=" << texture_target; - DCHECK_EQ(1u, textures_per_buffer); if (!vda_) return; @@ -331,28 +330,35 @@ } pixel_format_ = format; - if (!factories_->CreateTextures(count, - size, - &texture_ids, + const uint32_t texture_count = buffer_count * textures_per_buffer; + if (!factories_->CreateTextures(texture_count, size, &texture_ids, &texture_mailboxes, decoder_texture_target_)) { NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); return; } - DCHECK_EQ(count, texture_ids.size()); - DCHECK_EQ(count, texture_mailboxes.size()); + DCHECK_EQ(texture_count, texture_ids.size()); + DCHECK_EQ(texture_count, texture_mailboxes.size()); std::vector<media::PictureBuffer> picture_buffers; - for (size_t i = 0; i < texture_ids.size(); ++i) { + for (size_t buffer_index = 0; buffer_index < buffer_count; ++buffer_index) { media::PictureBuffer::TextureIds ids; - ids.push_back(texture_ids[i]); std::vector<gpu::Mailbox> mailboxes; - mailboxes.push_back(texture_mailboxes[i]); + for (size_t texture_index = 0; texture_index < textures_per_buffer; + ++texture_index) { + const size_t texture_id = + texture_index + textures_per_buffer * buffer_index; + ids.push_back(texture_ids[texture_id]); + mailboxes.push_back(texture_mailboxes[texture_id]); + } picture_buffers.push_back( media::PictureBuffer(next_picture_buffer_id_++, size, ids, mailboxes)); - bool inserted = assigned_picture_buffers_.insert(std::make_pair( - picture_buffers.back().id(), picture_buffers.back())).second; + const bool inserted = + assigned_picture_buffers_ + .insert(std::make_pair(picture_buffers.back().id(), + picture_buffers.back())) + .second; DCHECK(inserted); } vda_->AssignPictureBuffers(picture_buffers); @@ -374,7 +380,8 @@ if (!picture_buffers_at_display_.count(id)) { // We can delete the texture immediately as it's not being displayed. - factories_->DeleteTexture(buffer_to_dismiss.client_texture_ids()[0]); + for (const auto& id : buffer_to_dismiss.client_texture_ids()) + factories_->DeleteTexture(id); return; } // Not destroying a texture in display in |picture_buffers_at_display_|. @@ -415,7 +422,7 @@ } bool inserted = picture_buffers_at_display_ .insert(std::make_pair(picture.picture_buffer_id(), - pb.client_texture_ids()[0])) + pb.client_texture_ids())) .second; DCHECK(inserted); @@ -454,16 +461,18 @@ // This prevents the compositor from messing with it, since the underlying // platform can handle the former format natively. Make sure the // correct format is used and everyone down the line understands it. - gpu::MailboxHolder holders[media::VideoFrame::kMaxPlanes] = { - gpu::MailboxHolder(pb.texture_mailbox(0), gpu::SyncToken(), - decoder_texture_target_)}; + gpu::MailboxHolder holders[media::VideoFrame::kMaxPlanes]; + for (size_t i = 0; i < pb.client_texture_ids().size(); ++i) { + holders[i].mailbox = pb.texture_mailbox(i); + holders[i].texture_target = decoder_texture_target_; + } scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTextures( pixel_format, holders, - media::BindToCurrentLoop(base::Bind( - &RTCVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), - factories_, picture.picture_buffer_id(), - pb.client_texture_ids()[0])), + media::BindToCurrentLoop( + base::Bind(&RTCVideoDecoder::ReleaseMailbox, + weak_factory_.GetWeakPtr(), factories_, + picture.picture_buffer_id(), pb.client_texture_ids())), pb.size(), visible_rect, visible_rect.size(), timestamp_ms); if (frame && picture.allow_overlay()) { frame->metadata()->SetBoolean(media::VideoFrameMetadata::ALLOW_OVERLAY, @@ -686,7 +695,7 @@ base::WeakPtr<RTCVideoDecoder> decoder, media::GpuVideoAcceleratorFactories* factories, int64_t picture_buffer_id, - uint32_t texture_id, + const media::PictureBuffer::TextureIds& texture_ids, const gpu::SyncToken& release_sync_token) { DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); factories->WaitSyncToken(release_sync_token); @@ -697,7 +706,8 @@ } // It's the last chance to delete the texture after display, // because RTCVideoDecoder was destructed. - factories->DeleteTexture(texture_id); + for (const auto& id : texture_ids) + factories->DeleteTexture(id); } void RTCVideoDecoder::ReusePictureBuffer(int64_t picture_buffer_id) { @@ -707,13 +717,14 @@ DCHECK(!picture_buffers_at_display_.empty()); PictureBufferTextureMap::iterator display_iterator = picture_buffers_at_display_.find(picture_buffer_id); - uint32_t texture_id = display_iterator->second; + const auto texture_ids = display_iterator->second; DCHECK(display_iterator != picture_buffers_at_display_.end()); picture_buffers_at_display_.erase(display_iterator); if (!assigned_picture_buffers_.count(picture_buffer_id)) { // This picture was dismissed while in display, so we postponed deletion. - factories_->DeleteTexture(texture_id); + for (const auto& id : texture_ids) + factories_->DeleteTexture(id); return; } @@ -765,9 +776,10 @@ for (const auto& picture_buffer_at_display : picture_buffers_at_display_) assigned_picture_buffers_.erase(picture_buffer_at_display.first); - for (const auto& assigned_picture_buffer : assigned_picture_buffers_) - factories_->DeleteTexture( - assigned_picture_buffer.second.client_texture_ids()[0]); + for (const auto& assigned_picture_buffer : assigned_picture_buffers_) { + for (const auto& id : assigned_picture_buffer.second.client_texture_ids()) + factories_->DeleteTexture(id); + } assigned_picture_buffers_.clear(); }
diff --git a/content/renderer/media/gpu/rtc_video_decoder.h b/content/renderer/media/gpu/rtc_video_decoder.h index 12bc88b0..7b5b31f9 100644 --- a/content/renderer/media/gpu/rtc_video_decoder.h +++ b/content/renderer/media/gpu/rtc_video_decoder.h
@@ -156,11 +156,12 @@ void ResetInternal(); // Static method is to allow it to run even after RVD is deleted. - static void ReleaseMailbox(base::WeakPtr<RTCVideoDecoder> decoder, - media::GpuVideoAcceleratorFactories* factories, - int64_t picture_buffer_id, - uint32_t texture_id, - const gpu::SyncToken& release_sync_token); + static void ReleaseMailbox( + base::WeakPtr<RTCVideoDecoder> decoder, + media::GpuVideoAcceleratorFactories* factories, + int64_t picture_buffer_id, + const media::PictureBuffer::TextureIds& texture_ids, + const gpu::SyncToken& release_sync_token); // Tells VDA that a picture buffer can be recycled. void ReusePictureBuffer(int64_t picture_buffer_id); @@ -249,7 +250,8 @@ // PictureBuffers given to us by VDA via PictureReady, which we sent forward // as VideoFrames to be rendered via read_cb_, and which will be returned // to us via ReusePictureBuffer. - typedef std::map<int32_t /* picture_buffer_id */, uint32_t /* texture_id */> + typedef std::map<int32_t /* picture_buffer_id */, + media::PictureBuffer::TextureIds /* texture ids */> PictureBufferTextureMap; PictureBufferTextureMap picture_buffers_at_display_;
diff --git a/content/renderer/media/gpu/rtc_video_decoder_unittest.cc b/content/renderer/media/gpu/rtc_video_decoder_unittest.cc index 1aec6f3..ea476be 100644 --- a/content/renderer/media/gpu/rtc_video_decoder_unittest.cc +++ b/content/renderer/media/gpu/rtc_video_decoder_unittest.cc
@@ -141,6 +141,29 @@ idle_waiter_.Wait(); } + bool CreateMockTextures(int32_t count, + const gfx::Size& size, + std::vector<uint32_t>* texture_ids, + std::vector<gpu::Mailbox>* texture_mailboxes, + uint32_t texture_target) { + texture_ids->resize(count, 0); + texture_mailboxes->resize(count, gpu::Mailbox()); + return true; + } + + void ProvidePictureBuffers(uint32_t buffer_count, + media::VideoPixelFormat format, + uint32_t textures_per_buffer, + const gfx::Size& size, + uint32_t texture_target) { + vda_task_runner_->PostTask( + FROM_HERE, + base::Bind(&RTCVideoDecoder::ProvidePictureBuffers, + base::Unretained(rtc_decoder_.get()), buffer_count, format, + textures_per_buffer, size, texture_target)); + RunUntilIdle(); + } + void SetUpResetVDA() { mock_vda_after_reset_ = new media::MockVideoDecodeAccelerator; EXPECT_CALL(*mock_gpu_factories_.get(), DoCreateVideoDecodeAccelerator()) @@ -276,6 +299,28 @@ rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST)); } +TEST_F(RTCVideoDecoderTest, MultipleTexturesPerBuffer) { + CreateDecoder(webrtc::kVideoCodecVP8); + const uint32_t kBufferCount = 5; + const uint32_t kTexturesPerBuffer = 3; + const gfx::Size kSize(48, 48); + + EXPECT_CALL(*mock_gpu_factories_.get(), CreateTextures(_, _, _, _, _)) + .WillRepeatedly(Invoke(this, &RTCVideoDecoderTest::CreateMockTextures)); + EXPECT_CALL(*mock_gpu_factories_.get(), DeleteTexture(_)) + .Times(kBufferCount * kTexturesPerBuffer); + + std::vector<media::PictureBuffer> pbs; + EXPECT_CALL(*mock_vda_, AssignPictureBuffers(_)).WillOnce(SaveArg<0>(&pbs)); + ProvidePictureBuffers(kBufferCount, media::PIXEL_FORMAT_UNKNOWN, + kTexturesPerBuffer, kSize, 0); + EXPECT_EQ(kBufferCount, pbs.size()); + for (const auto pb : pbs) { + EXPECT_EQ(kSize, pb.size()); + EXPECT_EQ(kTexturesPerBuffer, pb.client_texture_ids().size()); + } +} + // Tests/Verifies that |rtc_encoder_| drops incoming frames and its error // counter is increased when in an error condition. TEST_P(RTCVideoDecoderTest, GetVDAErrorCounterForTesting) {
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn index 16cc7463..d13f4727 100644 --- a/content/shell/BUILD.gn +++ b/content/shell/BUILD.gn
@@ -210,6 +210,7 @@ # This exposes all public content APIs. "//content/public/app:both", "//content/public/browser", + "//content/public/child", "//content/public/common", "//content/public/renderer", "//content/public/utility",
diff --git a/content/shell/utility/shell_content_utility_client.cc b/content/shell/utility/shell_content_utility_client.cc index 0181ed2..b9b5fb7 100644 --- a/content/shell/utility/shell_content_utility_client.cc +++ b/content/shell/utility/shell_content_utility_client.cc
@@ -11,11 +11,14 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/ptr_util.h" #include "base/process/process.h" +#include "content/public/child/child_thread.h" +#include "content/public/common/service_manager_connection.h" +#include "content/public/common/simple_connection_filter.h" #include "content/public/test/test_service.h" #include "content/public/test/test_service.mojom.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "mojo/public/cpp/system/buffer.h" -#include "services/service_manager/public/cpp/interface_registry.h" +#include "services/service_manager/public/cpp/binder_registry.h" namespace content { @@ -76,15 +79,20 @@ ShellContentUtilityClient::~ShellContentUtilityClient() { } +void ShellContentUtilityClient::UtilityThreadStarted() { + auto registry = base::MakeUnique<service_manager::BinderRegistry>(); + registry->AddInterface(base::Bind(&TestServiceImpl::Create), + base::ThreadTaskRunnerHandle::Get()); + content::ChildThread::Get() + ->GetServiceManagerConnection() + ->AddConnectionFilter( + base::MakeUnique<SimpleConnectionFilter>(std::move(registry))); +} + void ShellContentUtilityClient::RegisterServices(StaticServiceMap* services) { ServiceInfo info; info.factory = base::Bind(&CreateTestService); services->insert(std::make_pair(kTestServiceUrl, info)); } -void ShellContentUtilityClient::ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry) { - registry->AddInterface(base::Bind(&TestServiceImpl::Create)); -} - } // namespace content
diff --git a/content/shell/utility/shell_content_utility_client.h b/content/shell/utility/shell_content_utility_client.h index e057705..3ab2f82b 100644 --- a/content/shell/utility/shell_content_utility_client.h +++ b/content/shell/utility/shell_content_utility_client.h
@@ -14,9 +14,8 @@ ~ShellContentUtilityClient() override; // ContentUtilityClient: + void UtilityThreadStarted() override; void RegisterServices(StaticServiceMap* services) override; - void ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry) override; }; } // namespace content
diff --git a/content/test/data/page_with_animation.html b/content/test/data/page_with_animation.html new file mode 100644 index 0000000..9c1c977 --- /dev/null +++ b/content/test/data/page_with_animation.html
@@ -0,0 +1,29 @@ +<!doctype html> +<html> + <head> + <style> + @keyframes move { + from { + transform: translate(-200px, 0); + } + to { + transform: translate(200px, 0); + } + } + + div { + height: 200px; + width: 200px; + + animation-duration: 1.5s; + animation-iteration-count: infinite; + animation-name: move; + + background: black; + } + </style> + </head> + <body> + <div></div> + </body> +</html>
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc index 36e0e1d..4f61f46 100644 --- a/content/utility/utility_thread_impl.cc +++ b/content/utility/utility_thread_impl.cc
@@ -14,12 +14,14 @@ #include "content/common/child_process_messages.h" #include "content/common/utility_messages.h" #include "content/public/common/content_switches.h" +#include "content/public/common/service_manager_connection.h" +#include "content/public/common/simple_connection_filter.h" #include "content/public/utility/content_utility_client.h" #include "content/utility/utility_blink_platform_impl.h" #include "content/utility/utility_service_factory.h" #include "ipc/ipc_sync_channel.h" #include "ppapi/features/features.h" -#include "services/service_manager/public/cpp/interface_registry.h" +#include "services/service_manager/public/cpp/binder_registry.h" #include "third_party/WebKit/public/web/WebKit.h" #if defined(OS_POSIX) && BUILDFLAG(ENABLE_PLUGINS) @@ -30,12 +32,15 @@ namespace content { UtilityThreadImpl::UtilityThreadImpl() - : ChildThreadImpl(ChildThreadImpl::Options::Builder().Build()) { + : ChildThreadImpl(ChildThreadImpl::Options::Builder() + .AutoStartServiceManagerConnection(false) + .Build()) { Init(); } UtilityThreadImpl::UtilityThreadImpl(const InProcessChildThreadParams& params) : ChildThreadImpl(ChildThreadImpl::Options::Builder() + .AutoStartServiceManagerConnection(false) .InBrowserProcess(params) .Build()) { Init(); @@ -79,14 +84,20 @@ void UtilityThreadImpl::Init() { batch_mode_ = false; ChildProcess::current()->AddRefProcess(); + + auto registry = base::MakeUnique<service_manager::BinderRegistry>(); + registry->AddInterface( + base::Bind(&UtilityThreadImpl::BindServiceFactoryRequest, + base::Unretained(this)), + base::ThreadTaskRunnerHandle::Get()); + ChildThread::Get()->GetServiceManagerConnection()->AddConnectionFilter( + base::MakeUnique<SimpleConnectionFilter>(std::move(registry))); + GetContentClient()->utility()->UtilityThreadStarted(); service_factory_.reset(new UtilityServiceFactory); - GetInterfaceRegistry()->AddInterface(base::Bind( - &UtilityThreadImpl::BindServiceFactoryRequest, base::Unretained(this))); - GetContentClient()->utility()->ExposeInterfacesToBrowser( - GetInterfaceRegistry()); + StartServiceManagerConnection(); } bool UtilityThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
diff --git a/device/media_transfer_protocol/OWNERS b/device/media_transfer_protocol/OWNERS index 9c18d8cf..7f803eb 100644 --- a/device/media_transfer_protocol/OWNERS +++ b/device/media_transfer_protocol/OWNERS
@@ -1,4 +1,4 @@ satorux@chromium.org thestig@chromium.org -# COMPONENT: Internals>Media +# COMPONENT: Platform>Apps>FileManager
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc index 650e811..bbc96f3 100644 --- a/extensions/renderer/module_system.cc +++ b/extensions/renderer/module_system.cc
@@ -23,6 +23,7 @@ #include "extensions/renderer/script_context_set.h" #include "extensions/renderer/source_map.h" #include "extensions/renderer/v8_helpers.h" +#include "gin/converter.h" #include "gin/modules/module_registry.h" #include "third_party/WebKit/public/web/WebFrame.h" @@ -551,8 +552,22 @@ DCHECK(!get_internal_api_.IsEmpty()); v8::HandleScope scope(GetIsolate()); if (source_map_->Contains(api_name)) { + // We need to load the custom bindings and store them in our modules. + // Storing them is important so that calls through CallModuleMethod() route + // to the proper objects, if they share the same name as an API. + v8::Local<v8::Value> modules; + if (!GetPrivate(context()->v8_context()->Global(), kModulesField, + &modules) || + !modules->IsObject()) { + NOTREACHED(); + return; + } + NativesEnabledScope enabled(this); - LoadModuleWithNativeAPIBridge(api_name, api_bridge_value); + v8::Local<v8::Value> exports = + LoadModuleWithNativeAPIBridge(api_name, api_bridge_value); + SetPrivateProperty(context()->v8_context(), modules.As<v8::Object>(), + gin::StringToSymbol(GetIsolate(), api_name), exports); } }
diff --git a/extensions/test/test_content_utility_client.cc b/extensions/test/test_content_utility_client.cc index fd01822a7..9e4e96b8 100644 --- a/extensions/test/test_content_utility_client.cc +++ b/extensions/test/test_content_utility_client.cc
@@ -4,6 +4,12 @@ #include "extensions/test/test_content_utility_client.h" +#include "base/memory/ptr_util.h" +#include "content/public/child/child_thread.h" +#include "content/public/common/service_manager_connection.h" +#include "content/public/common/simple_connection_filter.h" +#include "services/service_manager/public/cpp/binder_registry.h" + namespace extensions { TestContentUtilityClient::TestContentUtilityClient() = default; @@ -12,11 +18,13 @@ void TestContentUtilityClient::UtilityThreadStarted() { utility_handler::UtilityThreadStarted(); -} -void TestContentUtilityClient::ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry) { - utility_handler::ExposeInterfacesToBrowser(registry, false); + auto registry = base::MakeUnique<service_manager::BinderRegistry>(); + utility_handler::ExposeInterfacesToBrowser(registry.get(), false); + content::ChildThread::Get() + ->GetServiceManagerConnection() + ->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>( + std::move(registry))); } } // namespace extensions
diff --git a/extensions/test/test_content_utility_client.h b/extensions/test/test_content_utility_client.h index 03578f55d..18531eb 100644 --- a/extensions/test/test_content_utility_client.h +++ b/extensions/test/test_content_utility_client.h
@@ -17,8 +17,6 @@ // content::ContentUtilityClient: void UtilityThreadStarted() override; - void ExposeInterfacesToBrowser( - service_manager::InterfaceRegistry* registry) override; }; } // namespace extensions
diff --git a/extensions/utility/utility_handler.cc b/extensions/utility/utility_handler.cc index 4b8e4ac..b2260211 100644 --- a/extensions/utility/utility_handler.cc +++ b/extensions/utility/utility_handler.cc
@@ -17,7 +17,7 @@ #include "extensions/strings/grit/extensions_strings.h" #include "extensions/utility/unpacker.h" #include "mojo/public/cpp/bindings/strong_binding.h" -#include "services/service_manager/public/cpp/interface_registry.h" +#include "services/service_manager/public/cpp/binder_registry.h" #include "third_party/zlib/google/zip.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/ui_base_switches.h" @@ -134,15 +134,17 @@ extension_l10n_util::SetProcessLocale(lang); } -void ExposeInterfacesToBrowser(service_manager::InterfaceRegistry* registry, +void ExposeInterfacesToBrowser(service_manager::BinderRegistry* registry, bool running_elevated) { // If our process runs with elevated privileges, only add elevated Mojo // interfaces to the interface registry. if (running_elevated) return; - registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create)); - registry->AddInterface(base::Bind(&ManifestParserImpl::Create)); + registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create), + base::ThreadTaskRunnerHandle::Get()); + registry->AddInterface(base::Bind(&ManifestParserImpl::Create), + base::ThreadTaskRunnerHandle::Get()); } } // namespace utility_handler
diff --git a/extensions/utility/utility_handler.h b/extensions/utility/utility_handler.h index 92d514e..c2a70e92 100644 --- a/extensions/utility/utility_handler.h +++ b/extensions/utility/utility_handler.h
@@ -6,7 +6,7 @@ #define EXTENSIONS_UTILITY_UTILITY_HANDLER_H_ namespace service_manager { -class InterfaceRegistry; +class BinderRegistry; } namespace extensions { @@ -15,7 +15,7 @@ void UtilityThreadStarted(); -void ExposeInterfacesToBrowser(service_manager::InterfaceRegistry* registry, +void ExposeInterfacesToBrowser(service_manager::BinderRegistry* registry, bool running_elevated); } // namespace utility_handler
diff --git a/gpu/PRESUBMIT.py b/gpu/PRESUBMIT.py index b0c999a5..db256710 100644 --- a/gpu/PRESUBMIT.py +++ b/gpu/PRESUBMIT.py
@@ -16,6 +16,9 @@ to the regular CQ try bots. This test suite is too large to run against all Chromium commits, but should be run against changes likely to affect these tests. + + When adding/removing tests here, ensure that both gpu/PRESUBMIT.py and + ui/gl/PRESUBMIT.py are updated. """ return output_api.EnsureCQIncludeTrybotsAreAdded( cl,
diff --git a/ios/chrome/browser/find_in_page/find_tab_helper.mm b/ios/chrome/browser/find_in_page/find_tab_helper.mm index fd68d43..6653c59 100644 --- a/ios/chrome/browser/find_in_page/find_tab_helper.mm +++ b/ios/chrome/browser/find_in_page/find_tab_helper.mm
@@ -64,8 +64,8 @@ } void FindTabHelper::StopFinding(ProceduralBlock completion) { - [controller_ disableFindInPageWithCompletionHandler:completion]; SetFindUIActive(false); + [controller_ disableFindInPageWithCompletionHandler:completion]; } FindInPageModel* FindTabHelper::GetFindResult() const {
diff --git a/ios/chrome/browser/payments/BUILD.gn b/ios/chrome/browser/payments/BUILD.gn index 4538a01..e353acd 100644 --- a/ios/chrome/browser/payments/BUILD.gn +++ b/ios/chrome/browser/payments/BUILD.gn
@@ -41,9 +41,8 @@ "payment_request_view_controller_actions.h", "shipping_address_selection_coordinator.h", "shipping_address_selection_coordinator.mm", - "shipping_address_selection_view_controller.h", - "shipping_address_selection_view_controller.mm", - "shipping_address_selection_view_controller_actions.h", + "shipping_address_selection_mediator.h", + "shipping_address_selection_mediator.mm", "shipping_option_selection_coordinator.h", "shipping_option_selection_coordinator.mm", "shipping_option_selection_view_controller.h", @@ -139,7 +138,6 @@ "payment_request_unittest.mm", "payment_request_view_controller_unittest.mm", "shipping_address_selection_coordinator_unittest.mm", - "shipping_address_selection_view_controller_unittest.mm", "shipping_option_selection_coordinator_unittest.mm", "shipping_option_selection_view_controller_unittest.mm", ]
diff --git a/ios/chrome/browser/payments/payment_request_selector_view_controller.mm b/ios/chrome/browser/payments/payment_request_selector_view_controller.mm index 9f60365..d0e3b18a 100644 --- a/ios/chrome/browser/payments/payment_request_selector_view_controller.mm +++ b/ios/chrome/browser/payments/payment_request_selector_view_controller.mm
@@ -16,9 +16,8 @@ #import "ios/chrome/browser/ui/collection_view/collection_view_model.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/icons/chrome_icon.h" -#include "ios/chrome/browser/ui/uikit_ui_util.h" #include "ios/chrome/grit/ios_strings.h" -#include "ios/chrome/grit/ios_theme_resources.h" +#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #include "ui/base/l10n/l10n_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -130,6 +129,35 @@ UIEdgeInsetsMake(0, kSeparatorEdgeInset, 0, kSeparatorEdgeInset); } +#pragma mark UICollectionViewDataSource + +- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView + cellForItemAtIndexPath:(nonnull NSIndexPath*)indexPath { + CollectionViewModel* model = self.collectionViewModel; + + UICollectionViewCell* cell = + [super collectionView:collectionView cellForItemAtIndexPath:indexPath]; + + NSInteger itemType = [model itemTypeForIndexPath:indexPath]; + switch (itemType) { + case ItemTypeHeader: { + if ([cell isKindOfClass:[PaymentsTextCell class]]) { + PaymentsTextCell* textCell = + base::mac::ObjCCastStrict<PaymentsTextCell>(cell); + textCell.textLabel.textColor = + self.dataSource.state == PaymentRequestSelectorStateError + ? [[MDCPalette cr_redPalette] tint600] + : [[MDCPalette greyPalette] tint600]; + } + break; + } + default: + break; + } + + return cell; +} + #pragma mark UICollectionViewDelegate - (void)collectionView:(UICollectionView*)collectionView
diff --git a/ios/chrome/browser/payments/payment_request_selector_view_controller_data_source.h b/ios/chrome/browser/payments/payment_request_selector_view_controller_data_source.h index 028d9e8..18843bf 100644 --- a/ios/chrome/browser/payments/payment_request_selector_view_controller_data_source.h +++ b/ios/chrome/browser/payments/payment_request_selector_view_controller_data_source.h
@@ -38,7 +38,8 @@ // The selectable items to display in the collection. - (NSArray<CollectionViewItem<PaymentsHasAccessoryType>*>*)selectableItems; -// The selectable item at |index| in the collection. +// The selectable item at |index| in the collection. |index| should be smaller +// than self.selectableItems.count. - (CollectionViewItem<PaymentsHasAccessoryType>*)selectableItemAtIndex: (NSUInteger)index;
diff --git a/ios/chrome/browser/payments/shipping_address_selection_coordinator.h b/ios/chrome/browser/payments/shipping_address_selection_coordinator.h index 88d1a0dc..e8757fcf 100644 --- a/ios/chrome/browser/payments/shipping_address_selection_coordinator.h +++ b/ios/chrome/browser/payments/shipping_address_selection_coordinator.h
@@ -9,7 +9,7 @@ #include <vector> #import "ios/chrome/browser/chrome_coordinator.h" -#import "ios/chrome/browser/payments/shipping_address_selection_view_controller.h" +#import "ios/chrome/browser/payments/payment_request_selector_view_controller.h" class PaymentRequest; @@ -39,7 +39,7 @@ // selection view controller. This view controller will be presented by the view // controller provided in the initializer. @interface ShippingAddressSelectionCoordinator - : ChromeCoordinator<ShippingAddressSelectionViewControllerDelegate> + : ChromeCoordinator<PaymentRequestSelectorViewControllerDelegate> // The PaymentRequest object having a copy of web::PaymentRequest as provided by // the page invoking the Payment Request API. This pointer is not owned by this
diff --git a/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm b/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm index 91ec224..a2636da 100644 --- a/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm +++ b/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm
@@ -6,8 +6,11 @@ #include "base/strings/sys_string_conversions.h" #include "components/autofill/core/browser/autofill_profile.h" +#include "components/payments/core/strings_util.h" #include "ios/chrome/browser/payments/payment_request.h" +#include "ios/chrome/browser/payments/payment_request_selector_view_controller.h" #import "ios/chrome/browser/payments/payment_request_util.h" +#include "ios/chrome/browser/payments/shipping_address_selection_mediator.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -15,12 +18,16 @@ namespace { using ::payment_request_util::GetShippingAddressSelectorErrorMessage; +using ::payments::GetShippingAddressSectionString; +using ::payments::GetShippingAddressSelectorInfoMessage; } // namespace @interface ShippingAddressSelectionCoordinator () @property(nonatomic, strong) - ShippingAddressSelectionViewController* viewController; + PaymentRequestSelectorViewController* viewController; + +@property(nonatomic, strong) ShippingAddressSelectionMediator* mediator; // Called when the user selects a shipping address. The cell is checked, the // UI is locked so that the user can't interact with it, then the delegate is @@ -36,71 +43,89 @@ @synthesize paymentRequest = _paymentRequest; @synthesize delegate = _delegate; @synthesize viewController = _viewController; +@synthesize mediator = _mediator; - (void)start { - _viewController = [[ShippingAddressSelectionViewController alloc] - initWithPaymentRequest:_paymentRequest]; - [_viewController setDelegate:self]; - [_viewController loadModel]; + self.mediator = [[ShippingAddressSelectionMediator alloc] + initWithPaymentRequest:self.paymentRequest]; + self.mediator.headerText = + self.paymentRequest->shipping_options().empty() + ? base::SysUTF16ToNSString(GetShippingAddressSelectorInfoMessage( + self.paymentRequest->shipping_type())) + : nil; + + self.viewController = [[PaymentRequestSelectorViewController alloc] init]; + self.viewController.title = base::SysUTF16ToNSString( + GetShippingAddressSectionString(self.paymentRequest->shipping_type())); + self.viewController.delegate = self; + self.viewController.dataSource = self.mediator; + [self.viewController loadModel]; DCHECK(self.baseViewController.navigationController); [self.baseViewController.navigationController - pushViewController:_viewController + pushViewController:self.viewController animated:YES]; } - (void)stop { [self.baseViewController.navigationController popViewControllerAnimated:YES]; - _viewController = nil; + self.viewController = nil; + self.mediator = nil; } - (void)stopSpinnerAndDisplayError { // Re-enable user interactions that were disabled earlier in // delayedNotifyDelegateOfSelection. - _viewController.view.userInteractionEnabled = YES; + self.viewController.view.userInteractionEnabled = YES; - [_viewController setPending:NO]; - DCHECK(_paymentRequest); - [_viewController - setErrorMessage:GetShippingAddressSelectorErrorMessage(*_paymentRequest)]; - [_viewController loadModel]; - [[_viewController collectionView] reloadData]; + DCHECK(self.paymentRequest); + self.mediator.headerText = + GetShippingAddressSelectorErrorMessage(*self.paymentRequest); + self.mediator.state = PaymentRequestSelectorStateError; + [self.viewController loadModel]; + [self.viewController.collectionView reloadData]; } -#pragma mark - ShippingAddressSelectionViewControllerDelegate +#pragma mark - PaymentRequestSelectorViewControllerDelegate -- (void)shippingAddressSelectionViewController: - (ShippingAddressSelectionViewController*)controller - didSelectShippingAddress: - (autofill::AutofillProfile*)shippingAddress { - [self delayedNotifyDelegateOfSelection:shippingAddress]; +- (void)paymentRequestSelectorViewController: + (PaymentRequestSelectorViewController*)controller + didSelectItemAtIndex:(NSUInteger)index { + // Update the data source with the selection. + self.mediator.selectedItemIndex = index; + + DCHECK(index < self.paymentRequest->shipping_profiles().size()); + [self delayedNotifyDelegateOfSelection:self.paymentRequest + ->shipping_profiles()[index]]; } -- (void)shippingAddressSelectionViewControllerDidReturn: - (ShippingAddressSelectionViewController*)controller { - [_delegate shippingAddressSelectionCoordinatorDidReturn:self]; +- (void)paymentRequestSelectorViewControllerDidFinish: + (PaymentRequestSelectorViewController*)controller { + [self.delegate shippingAddressSelectionCoordinatorDidReturn:self]; } +- (void)paymentRequestSelectorViewControllerDidSelectAddItem: + (PaymentRequestSelectorViewController*)controller { + // TODO(crbug.com/602666): Present a shipping address addition UI. +} + +#pragma mark - Helper methods + - (void)delayedNotifyDelegateOfSelection: (autofill::AutofillProfile*)shippingAddress { - _viewController.view.userInteractionEnabled = NO; + self.viewController.view.userInteractionEnabled = NO; __weak ShippingAddressSelectionCoordinator* weakSelf = self; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, - static_cast<int64_t>(0.2 * NSEC_PER_SEC)), - dispatch_get_main_queue(), ^{ - ShippingAddressSelectionCoordinator* strongSelf = weakSelf; - // Early return if the coordinator has been deallocated. - if (!strongSelf) - return; + dispatch_after( + dispatch_time(DISPATCH_TIME_NOW, + static_cast<int64_t>(0.2 * NSEC_PER_SEC)), + dispatch_get_main_queue(), ^{ + [weakSelf.mediator setState:PaymentRequestSelectorStatePending]; + [weakSelf.viewController loadModel]; + [[weakSelf.viewController collectionView] reloadData]; - [strongSelf.viewController setPending:YES]; - [strongSelf.viewController loadModel]; - [[strongSelf.viewController collectionView] reloadData]; - - [strongSelf.delegate - shippingAddressSelectionCoordinator:strongSelf - didSelectShippingAddress:shippingAddress]; - }); + [weakSelf.delegate shippingAddressSelectionCoordinator:weakSelf + didSelectShippingAddress:shippingAddress]; + }); } @end
diff --git a/ios/chrome/browser/payments/shipping_address_selection_coordinator_unittest.mm b/ios/chrome/browser/payments/shipping_address_selection_coordinator_unittest.mm index c7b4965..59f825d 100644 --- a/ios/chrome/browser/payments/shipping_address_selection_coordinator_unittest.mm +++ b/ios/chrome/browser/payments/shipping_address_selection_coordinator_unittest.mm
@@ -8,12 +8,11 @@ #include "base/memory/ptr_util.h" #include "base/test/ios/wait_util.h" #include "components/autofill/core/browser/autofill_profile.h" -#include "components/autofill/core/browser/credit_card.h" +#include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/test_personal_data_manager.h" #include "ios/chrome/browser/payments/payment_request.h" +#import "ios/chrome/browser/payments/payment_request_selector_view_controller.h" #include "ios/chrome/browser/payments/payment_request_test_util.h" -#import "ios/chrome/browser/payments/shipping_address_selection_view_controller.h" -#include "ios/web/public/payments/payment_request.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" #include "third_party/ocmock/OCMock/OCMock.h" @@ -26,18 +25,25 @@ class PaymentRequestShippingAddressSelectionCoordinatorTest : public PlatformTest { protected: - PaymentRequestShippingAddressSelectionCoordinatorTest() { + PaymentRequestShippingAddressSelectionCoordinatorTest() + : autofill_profile1_(autofill::test::GetFullProfile()), + autofill_profile2_(autofill::test::GetFullProfile2()) { + // Add testing profiles to autofill::TestPersonalDataManager. + personal_data_manager_.AddTestingProfile(&autofill_profile1_); + personal_data_manager_.AddTestingProfile(&autofill_profile2_); payment_request_ = base::MakeUnique<PaymentRequest>( payment_request_test_util::CreateTestWebPaymentRequest(), &personal_data_manager_); } + autofill::AutofillProfile autofill_profile1_; + autofill::AutofillProfile autofill_profile2_; autofill::TestPersonalDataManager personal_data_manager_; std::unique_ptr<PaymentRequest> payment_request_; }; // Tests that invoking start and stop on the coordinator presents and dismisses -// the ShippingAddressSelectionViewController, respectively. +// the PaymentRequestSelectorViewController, respectively. TEST_F(PaymentRequestShippingAddressSelectionCoordinatorTest, StartAndStop) { UIViewController* base_view_controller = [[UIViewController alloc] init]; UINavigationController* navigation_controller = @@ -59,7 +65,7 @@ UIViewController* view_controller = navigation_controller.visibleViewController; EXPECT_TRUE([view_controller - isMemberOfClass:[ShippingAddressSelectionViewController class]]); + isMemberOfClass:[PaymentRequestSelectorViewController class]]); [coordinator stop]; // Short delay to allow animation to complete. @@ -85,9 +91,9 @@ // Mock the coordinator delegate. id delegate = [OCMockObject mockForProtocol:@protocol(ShippingAddressSelectionCoordinatorDelegate)]; - autofill::AutofillProfile profile; + autofill::AutofillProfile* profile = payment_request_->shipping_profiles()[1]; [[delegate expect] shippingAddressSelectionCoordinator:coordinator - didSelectShippingAddress:&profile]; + didSelectShippingAddress:profile]; [coordinator setDelegate:delegate]; EXPECT_EQ(1u, navigation_controller.viewControllers.count); @@ -98,11 +104,11 @@ EXPECT_EQ(2u, navigation_controller.viewControllers.count); // Call the controller delegate method. - ShippingAddressSelectionViewController* view_controller = - base::mac::ObjCCastStrict<ShippingAddressSelectionViewController>( + PaymentRequestSelectorViewController* view_controller = + base::mac::ObjCCastStrict<PaymentRequestSelectorViewController>( navigation_controller.visibleViewController); - [coordinator shippingAddressSelectionViewController:view_controller - didSelectShippingAddress:&profile]; + [coordinator paymentRequestSelectorViewController:view_controller + didSelectItemAtIndex:1]; // Wait for the coordinator delegate to be notified. base::test::ios::SpinRunLoopWithMinDelay(base::TimeDelta::FromSecondsD(0.5)); @@ -138,10 +144,10 @@ EXPECT_EQ(2u, navigation_controller.viewControllers.count); // Call the controller delegate method. - ShippingAddressSelectionViewController* view_controller = - base::mac::ObjCCastStrict<ShippingAddressSelectionViewController>( + PaymentRequestSelectorViewController* view_controller = + base::mac::ObjCCastStrict<PaymentRequestSelectorViewController>( navigation_controller.visibleViewController); - [coordinator shippingAddressSelectionViewControllerDidReturn:view_controller]; + [coordinator paymentRequestSelectorViewControllerDidFinish:view_controller]; EXPECT_OCMOCK_VERIFY(delegate); }
diff --git a/ios/chrome/browser/payments/shipping_address_selection_mediator.h b/ios/chrome/browser/payments/shipping_address_selection_mediator.h new file mode 100644 index 0000000..7ba45aae --- /dev/null +++ b/ios/chrome/browser/payments/shipping_address_selection_mediator.h
@@ -0,0 +1,36 @@ +// Copyright 2017 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_PAYMENTS_SHIPPING_ADDRESS_SELECTION_MEDIATOR_H_ +#define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_MEDIATOR_H_ + +#import "ios/chrome/browser/payments/payment_request_selector_view_controller_data_source.h" + +class PaymentRequest; + +// Serves as data source for PaymentRequestSelectorViewController. +@interface ShippingAddressSelectionMediator + : NSObject<PaymentRequestSelectorViewControllerDataSource> + +// The text to display in the header item. If nil, the header item will also be +// nil. +@property(nonatomic, copy) NSString* headerText; + +// The current state of the view controller. +@property(nonatomic, readwrite, assign) PaymentRequestSelectorState state; + +// Index for the currently selected item or NSUIntegerMax if there is none. +@property(nonatomic, readwrite, assign) NSUInteger selectedItemIndex; + +// Initializes this object with an instance of PaymentRequest which has a copy +// of web::PaymentRequest as provided by the page invoking the Payment Request +// API. This object will not take ownership of |paymentRequest|. +- (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest + NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +#endif // IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_MEDIATOR_H_
diff --git a/ios/chrome/browser/payments/shipping_address_selection_mediator.mm b/ios/chrome/browser/payments/shipping_address_selection_mediator.mm new file mode 100644 index 0000000..bc947e6 --- /dev/null +++ b/ios/chrome/browser/payments/shipping_address_selection_mediator.mm
@@ -0,0 +1,110 @@ +// Copyright 2017 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 <vector> + +#import "ios/chrome/browser/payments/shipping_address_selection_mediator.h" + +#include "components/autofill/core/browser/autofill_profile.h" +#include "components/strings/grit/components_strings.h" +#import "ios/chrome/browser/payments/cells/autofill_profile_item.h" +#import "ios/chrome/browser/payments/cells/payments_text_item.h" +#include "ios/chrome/browser/payments/payment_request.h" +#import "ios/chrome/browser/payments/payment_request_util.h" +#include "ios/chrome/browser/ui/uikit_ui_util.h" +#include "ios/chrome/grit/ios_theme_resources.h" +#include "ui/base/l10n/l10n_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { +using ::payment_request_util::GetNameLabelFromAutofillProfile; +using ::payment_request_util::GetShippingAddressLabelFromAutofillProfile; +using ::payment_request_util::GetPhoneNumberLabelFromAutofillProfile; +} // namespace + +@interface ShippingAddressSelectionMediator () + +// The PaymentRequest object owning an instance of web::PaymentRequest as +// provided by the page invoking the Payment Request API. This is a weak +// pointer and should outlive this class. +@property(nonatomic, assign) PaymentRequest* paymentRequest; + +// The selectable items to display in the collection. +@property(nonatomic, strong) NSArray<AutofillProfileItem*>* items; + +@end + +@implementation ShippingAddressSelectionMediator + +@synthesize state = _state; +@synthesize selectedItemIndex = _selectedItemIndex; +@synthesize paymentRequest = _paymentRequest; +@synthesize items = _items; +@synthesize headerText = _headerText; + +- (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest { + self = [super init]; + if (self) { + _paymentRequest = paymentRequest; + _selectedItemIndex = NSUIntegerMax; + _items = [self createItems]; + } + return self; +} + +#pragma mark - PaymentRequestSelectorViewControllerDataSource + +- (CollectionViewItem*)headerItem { + if (!self.headerText.length) + return nil; + + PaymentsTextItem* headerItem = [[PaymentsTextItem alloc] init]; + headerItem.text = self.headerText; + if (self.state == PaymentRequestSelectorStateError) + headerItem.image = NativeImage(IDR_IOS_PAYMENTS_WARNING); + return headerItem; +} + +- (NSArray<CollectionViewItem*>*)selectableItems { + return self.items; +} + +- (CollectionViewItem*)selectableItemAtIndex:(NSUInteger)index { + DCHECK(index < self.items.count); + return [self.items objectAtIndex:index]; +} + +- (CollectionViewItem*)addButtonItem { + PaymentsTextItem* addButtonItem = [[PaymentsTextItem alloc] init]; + addButtonItem.text = l10n_util::GetNSString(IDS_PAYMENTS_ADD_ADDRESS); + addButtonItem.image = NativeImage(IDR_IOS_PAYMENTS_ADD); + return addButtonItem; +} + +#pragma mark - Helper methods + +- (NSArray<AutofillProfileItem*>*)createItems { + const std::vector<autofill::AutofillProfile*>& shippingProfiles = + _paymentRequest->shipping_profiles(); + NSMutableArray<AutofillProfileItem*>* items = + [NSMutableArray arrayWithCapacity:shippingProfiles.size()]; + for (size_t index = 0; index < shippingProfiles.size(); ++index) { + autofill::AutofillProfile* shippingAddress = shippingProfiles[index]; + DCHECK(shippingAddress); + AutofillProfileItem* item = [[AutofillProfileItem alloc] init]; + item.name = GetNameLabelFromAutofillProfile(*shippingAddress); + item.address = GetShippingAddressLabelFromAutofillProfile(*shippingAddress); + item.phoneNumber = GetPhoneNumberLabelFromAutofillProfile(*shippingAddress); + if (_paymentRequest->selected_shipping_profile() == shippingAddress) + _selectedItemIndex = index; + + [items addObject:item]; + } + return items; +} + +@end
diff --git a/ios/chrome/browser/payments/shipping_address_selection_view_controller.h b/ios/chrome/browser/payments/shipping_address_selection_view_controller.h deleted file mode 100644 index 9bfd184..0000000 --- a/ios/chrome/browser/payments/shipping_address_selection_view_controller.h +++ /dev/null
@@ -1,65 +0,0 @@ -// 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_PAYMENTS_SHIPPING_ADDRESS_SELECTION_VIEW_CONTROLLER_H_ -#define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_VIEW_CONTROLLER_H_ - -#import <UIKit/UIKit.h> - -#import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" - -class PaymentRequest; - -namespace autofill { -class AutofillProfile; -} // namespace autofill - -@class ShippingAddressSelectionViewController; - -// Delegate protocol for ShippingAddressSelectionViewController. -@protocol ShippingAddressSelectionViewControllerDelegate<NSObject> - -// Notifies the delegate that the user has selected a shipping address. -- (void)shippingAddressSelectionViewController: - (ShippingAddressSelectionViewController*)controller - didSelectShippingAddress: - (autofill::AutofillProfile*)shippingAddress; - -// Notifies the delegate that the user has chosen to return to the previous -// screen without making a selection. -- (void)shippingAddressSelectionViewControllerDidReturn: - (ShippingAddressSelectionViewController*)controller; - -@end - -// View controller responsible for presenting the available shipping addresses -// for selection by the user and communicating their choice to the supplied -// delegate. Also offers a button to add a shipping address. -@interface ShippingAddressSelectionViewController : CollectionViewController - -// Whether or not the view is in a pending state. -@property(nonatomic, assign, getter=isPending) BOOL pending; - -// The error message to display, if any. -@property(nonatomic, copy) NSString* errorMessage; - -// The delegate to be notified when the user selects a shipping address or -// returns without selecting one. -@property(nonatomic, weak) - id<ShippingAddressSelectionViewControllerDelegate> delegate; - -// Initializes this object with an instance of PaymentRequest which has a copy -// of web::PaymentRequest as provided by the page invoking the Payment Request -// API. This object will not take ownership of |paymentRequest|. -- (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest - NS_DESIGNATED_INITIALIZER; - -- (instancetype)init NS_UNAVAILABLE; - -- (instancetype)initWithStyle:(CollectionViewControllerStyle)style - NS_UNAVAILABLE; - -@end - -#endif // IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/payments/shipping_address_selection_view_controller.mm b/ios/chrome/browser/payments/shipping_address_selection_view_controller.mm deleted file mode 100644 index ef86e68..0000000 --- a/ios/chrome/browser/payments/shipping_address_selection_view_controller.mm +++ /dev/null
@@ -1,259 +0,0 @@ -// 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/payments/shipping_address_selection_view_controller.h" - -#include "base/mac/foundation_util.h" - -#include "base/strings/sys_string_conversions.h" -#include "components/autofill/core/browser/autofill_profile.h" -#include "components/payments/core/strings_util.h" -#include "components/strings/grit/components_strings.h" -#include "ios/chrome/browser/application_context.h" -#import "ios/chrome/browser/payments/cells/autofill_profile_item.h" -#import "ios/chrome/browser/payments/cells/payments_text_item.h" -#include "ios/chrome/browser/payments/payment_request.h" -#import "ios/chrome/browser/payments/payment_request_util.h" -#import "ios/chrome/browser/payments/shipping_address_selection_view_controller_actions.h" -#import "ios/chrome/browser/ui/autofill/cells/status_item.h" -#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" -#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" -#import "ios/chrome/browser/ui/collection_view/collection_view_model.h" -#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" -#import "ios/chrome/browser/ui/icons/chrome_icon.h" -#include "ios/chrome/browser/ui/uikit_ui_util.h" -#include "ios/chrome/grit/ios_strings.h" -#include "ios/chrome/grit/ios_theme_resources.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { -using ::payment_request_util::GetNameLabelFromAutofillProfile; -using ::payment_request_util::GetShippingAddressLabelFromAutofillProfile; -using ::payment_request_util::GetPhoneNumberLabelFromAutofillProfile; -using ::payments::GetShippingAddressSelectorInfoMessage; -using ::payments::GetShippingAddressSectionString; - -NSString* const kShippingAddressSelectionCollectionViewID = - @"kShippingAddressSelectionCollectionViewID"; - -const CGFloat kSeparatorEdgeInset = 14; - -typedef NS_ENUM(NSInteger, SectionIdentifier) { - SectionIdentifierShippingAddress = kSectionIdentifierEnumZero, -}; - -typedef NS_ENUM(NSInteger, ItemType) { - ItemTypeSpinner = kItemTypeEnumZero, - ItemTypeMessage, - ItemTypeShippingAddress, // This is a repeated item type. - ItemTypeAddShippingAddress, -}; - -} // namespace - -@interface ShippingAddressSelectionViewController ()< - ShippingAddressSelectionViewControllerActions> { - // The PaymentRequest object having a copy of web::PaymentRequest as provided - // by the page invoking the Payment Request API. This is a weak pointer and - // should outlive this class. - PaymentRequest* _paymentRequest; - - // The currently selected item. May be nil. - __weak AutofillProfileItem* _selectedItem; -} - -@end - -@implementation ShippingAddressSelectionViewController - -@synthesize pending = _pending; -@synthesize errorMessage = _errorMessage; -@synthesize delegate = _delegate; - -- (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest { - DCHECK(paymentRequest); - if ((self = [super initWithStyle:CollectionViewControllerStyleAppBar])) { - self.title = base::SysUTF16ToNSString( - GetShippingAddressSectionString(paymentRequest->shipping_type())); - - // Set up leading (return) button. - UIBarButtonItem* returnButton = - [ChromeIcon templateBarButtonItemWithImage:[ChromeIcon backIcon] - target:nil - action:@selector(onReturn)]; - returnButton.accessibilityLabel = l10n_util::GetNSString(IDS_ACCNAME_BACK); - self.navigationItem.leftBarButtonItem = returnButton; - - _paymentRequest = paymentRequest; - } - return self; -} - -- (void)onReturn { - [_delegate shippingAddressSelectionViewControllerDidReturn:self]; -} - -#pragma mark - CollectionViewController methods - -- (void)loadModel { - [super loadModel]; - CollectionViewModel* model = self.collectionViewModel; - _selectedItem = nil; - - [model addSectionWithIdentifier:SectionIdentifierShippingAddress]; - - if (_pending) { - StatusItem* statusItem = [[StatusItem alloc] initWithType:ItemTypeSpinner]; - statusItem.text = l10n_util::GetNSString(IDS_PAYMENTS_CHECKING_OPTION); - [model addItem:statusItem - toSectionWithIdentifier:SectionIdentifierShippingAddress]; - return; - } - - PaymentsTextItem* messageItem = - [[PaymentsTextItem alloc] initWithType:ItemTypeMessage]; - if (_errorMessage) { - messageItem.text = _errorMessage; - messageItem.image = NativeImage(IDR_IOS_PAYMENTS_WARNING); - } else { - messageItem.text = - base::SysUTF16ToNSString(GetShippingAddressSelectorInfoMessage( - _paymentRequest->shipping_type())); - } - [model addItem:messageItem - toSectionWithIdentifier:SectionIdentifierShippingAddress]; - - for (auto* shippingAddress : _paymentRequest->shipping_profiles()) { - DCHECK(shippingAddress); - AutofillProfileItem* item = - [[AutofillProfileItem alloc] initWithType:ItemTypeShippingAddress]; - item.accessibilityTraits |= UIAccessibilityTraitButton; - item.name = GetNameLabelFromAutofillProfile(*shippingAddress); - item.address = GetShippingAddressLabelFromAutofillProfile(*shippingAddress); - item.phoneNumber = GetPhoneNumberLabelFromAutofillProfile(*shippingAddress); - if (_paymentRequest->selected_shipping_profile() == shippingAddress) { - item.accessoryType = MDCCollectionViewCellAccessoryCheckmark; - _selectedItem = item; - } - [model addItem:item - toSectionWithIdentifier:SectionIdentifierShippingAddress]; - } - - PaymentsTextItem* addShippingAddress = - [[PaymentsTextItem alloc] initWithType:ItemTypeAddShippingAddress]; - addShippingAddress.text = l10n_util::GetNSString(IDS_PAYMENTS_ADD_ADDRESS); - addShippingAddress.image = NativeImage(IDR_IOS_PAYMENTS_ADD); - addShippingAddress.accessibilityTraits |= UIAccessibilityTraitButton; - [model addItem:addShippingAddress - toSectionWithIdentifier:SectionIdentifierShippingAddress]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - self.collectionView.accessibilityIdentifier = - kShippingAddressSelectionCollectionViewID; - - // Customize collection view settings. - self.styler.cellStyle = MDCCollectionViewCellStyleCard; - self.styler.separatorInset = - UIEdgeInsetsMake(0, kSeparatorEdgeInset, 0, kSeparatorEdgeInset); -} - -#pragma mark UICollectionViewDataSource - -- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView - cellForItemAtIndexPath:(nonnull NSIndexPath*)indexPath { - UICollectionViewCell* cell = - [super collectionView:collectionView cellForItemAtIndexPath:indexPath]; - - NSInteger itemType = - [self.collectionViewModel itemTypeForIndexPath:indexPath]; - switch (itemType) { - case ItemTypeMessage: { - PaymentsTextCell* messageCell = - base::mac::ObjCCastStrict<PaymentsTextCell>(cell); - messageCell.textLabel.textColor = - _errorMessage ? [[MDCPalette cr_redPalette] tint600] - : [[MDCPalette greyPalette] tint600]; - break; - } - default: - break; - } - return cell; -} - -#pragma mark UICollectionViewDelegate - -- (void)collectionView:(UICollectionView*)collectionView - didSelectItemAtIndexPath:(NSIndexPath*)indexPath { - [super collectionView:collectionView didSelectItemAtIndexPath:indexPath]; - - CollectionViewModel* model = self.collectionViewModel; - - CollectionViewItem* item = [model itemAtIndexPath:indexPath]; - if (item.type == ItemTypeShippingAddress) { - // Update the currently selected cell, if any. - if (_selectedItem) { - _selectedItem.accessoryType = MDCCollectionViewCellAccessoryNone; - [self reconfigureCellsForItems:@[ _selectedItem ] - inSectionWithIdentifier:SectionIdentifierShippingAddress]; - } - - // Update the newly selected cell. - AutofillProfileItem* newlySelectedItem = - base::mac::ObjCCastStrict<AutofillProfileItem>(item); - newlySelectedItem.accessoryType = MDCCollectionViewCellAccessoryCheckmark; - [self reconfigureCellsForItems:@[ newlySelectedItem ] - inSectionWithIdentifier:SectionIdentifierShippingAddress]; - - // Update the reference to the selected item. - _selectedItem = newlySelectedItem; - - // Notify the delegate of the selection. - NSInteger index = [model indexInItemTypeForIndexPath:indexPath]; - DCHECK(index < (NSInteger)_paymentRequest->shipping_profiles().size()); - [_delegate shippingAddressSelectionViewController:self - didSelectShippingAddress: - _paymentRequest->shipping_profiles()[index]]; - } - // TODO(crbug.com/602666): Present a shipping address addition UI when - // itemType == ItemTypeAddShippingAddress. -} - -#pragma mark MDCCollectionViewStylingDelegate - -- (CGFloat)collectionView:(UICollectionView*)collectionView - cellHeightAtIndexPath:(NSIndexPath*)indexPath { - CollectionViewItem* item = - [self.collectionViewModel itemAtIndexPath:indexPath]; - switch (item.type) { - case ItemTypeSpinner: - case ItemTypeMessage: - case ItemTypeShippingAddress: - case ItemTypeAddShippingAddress: - return [MDCCollectionViewCell - cr_preferredHeightForWidth:CGRectGetWidth(collectionView.bounds) - forItem:item]; - default: - NOTREACHED(); - return MDCCellDefaultOneLineHeight; - } -} - -- (BOOL)collectionView:(UICollectionView*)collectionView - hidesInkViewAtIndexPath:(NSIndexPath*)indexPath { - NSInteger type = [self.collectionViewModel itemTypeForIndexPath:indexPath]; - if (type == ItemTypeMessage) { - return YES; - } else { - return NO; - } -} - -@end
diff --git a/ios/chrome/browser/payments/shipping_address_selection_view_controller_actions.h b/ios/chrome/browser/payments/shipping_address_selection_view_controller_actions.h deleted file mode 100644 index a8ebfb9..0000000 --- a/ios/chrome/browser/payments/shipping_address_selection_view_controller_actions.h +++ /dev/null
@@ -1,17 +0,0 @@ -// Copyright 2017 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_PAYMENTS_SHIPPING_ADDRESS_SELECTION_VIEW_CONTROLLER_ACTIONS_H_ -#define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_VIEW_CONTROLLER_ACTIONS_H_ - -// Protocol handling the actions sent in the -// ShippingAddressSelectionViewController. -@protocol ShippingAddressSelectionViewControllerActions - -// Called when the user presses the return button. -- (void)onReturn; - -@end - -#endif // IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_VIEW_CONTROLLER_ACTIONS_H_
diff --git a/ios/chrome/browser/payments/shipping_address_selection_view_controller_unittest.mm b/ios/chrome/browser/payments/shipping_address_selection_view_controller_unittest.mm deleted file mode 100644 index 3c69fe4e9..0000000 --- a/ios/chrome/browser/payments/shipping_address_selection_view_controller_unittest.mm +++ /dev/null
@@ -1,112 +0,0 @@ -// 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/payments/shipping_address_selection_view_controller.h" - -#include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" -#include "components/autofill/core/browser/autofill_profile.h" -#include "components/autofill/core/browser/autofill_test_utils.h" -#include "components/autofill/core/browser/test_personal_data_manager.h" -#include "components/strings/grit/components_strings.h" -#import "ios/chrome/browser/payments/cells/autofill_profile_item.h" -#import "ios/chrome/browser/payments/cells/payments_text_item.h" -#include "ios/chrome/browser/payments/payment_request.h" -#include "ios/chrome/browser/payments/payment_request_test_util.h" -#import "ios/chrome/browser/ui/autofill/cells/status_item.h" -#import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h" -#include "ios/web/public/payments/payment_request.h" -#include "testing/gtest/include/gtest/gtest.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -class PaymentRequestShippingAddressSelectionViewControllerTest - : public CollectionViewControllerTest { - protected: - PaymentRequestShippingAddressSelectionViewControllerTest() - : autofill_profile1_(autofill::test::GetFullProfile()), - autofill_profile2_(autofill::test::GetFullProfile2()) { - // Add testing profiles to autofill::TestPersonalDataManager. - personal_data_manager_.AddTestingProfile(&autofill_profile1_); - personal_data_manager_.AddTestingProfile(&autofill_profile2_); - } - - CollectionViewController* InstantiateController() override { - payment_request_ = base::MakeUnique<PaymentRequest>( - payment_request_test_util::CreateTestWebPaymentRequest(), - &personal_data_manager_); - - return [[ShippingAddressSelectionViewController alloc] - initWithPaymentRequest:payment_request_.get()]; - } - - ShippingAddressSelectionViewController* - GetShippingAddressSelectionViewController() { - return base::mac::ObjCCastStrict<ShippingAddressSelectionViewController>( - controller()); - } - - autofill::AutofillProfile autofill_profile1_; - autofill::AutofillProfile autofill_profile2_; - autofill::TestPersonalDataManager personal_data_manager_; - std::unique_ptr<PaymentRequest> payment_request_; -}; - -// Tests that the correct number of items are displayed after loading the model -// and that the correct item appears to be selected. -TEST_F(PaymentRequestShippingAddressSelectionViewControllerTest, TestModel) { - CreateController(); - CheckController(); - CheckTitleWithId(IDS_PAYMENTS_SHIPPING_ADDRESS_LABEL); - - [GetShippingAddressSelectionViewController() loadModel]; - - ASSERT_EQ(1, NumberOfSections()); - // One item for each of shipping addresses plus 2 for the message and the add - // button. - ASSERT_EQ(4U, static_cast<unsigned int>(NumberOfItemsInSection(0))); - - // The first item should be of type TextAndMessageItem. - id item = GetCollectionViewItem(0, 0); - EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]); - - // The next two items should be of type AutofillProfileItem. The first one - // should appear to be selected. - item = GetCollectionViewItem(0, 1); - ASSERT_TRUE([item isMemberOfClass:[AutofillProfileItem class]]); - AutofillProfileItem* shipping_address_item = item; - EXPECT_EQ(MDCCollectionViewCellAccessoryCheckmark, - shipping_address_item.accessoryType); - - item = GetCollectionViewItem(0, 2); - EXPECT_TRUE([item isMemberOfClass:[AutofillProfileItem class]]); - shipping_address_item = item; - EXPECT_EQ(MDCCollectionViewCellAccessoryNone, - shipping_address_item.accessoryType); - - // The last item should also be of type TextAndMessageItem. - item = GetCollectionViewItem(0, 3); - EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]); - - // Test the error state. - [GetShippingAddressSelectionViewController() setErrorMessage:@"Lorem ipsum"]; - [GetShippingAddressSelectionViewController() loadModel]; - ASSERT_EQ(1, NumberOfSections()); - // There should stil be 4 items in total. - ASSERT_EQ(4U, static_cast<unsigned int>(NumberOfItemsInSection(0))); - - // Test the pending state. - [GetShippingAddressSelectionViewController() setPending:YES]; - [GetShippingAddressSelectionViewController() loadModel]; - - ASSERT_EQ(1, NumberOfSections()); - // There should be only one item. - ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); - - // The item should be of type StatusItem. - item = GetCollectionViewItem(0, 0); - EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); -}
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm b/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm index 44c9dd0d..289d4754f 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm +++ b/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm
@@ -150,7 +150,8 @@ const BookmarkNode* defaultFolder = [[self class] folderForNewBookmarksInBrowserState:_browserState]; self.bookmarkModel->AddURL(defaultFolder, defaultFolder->child_count(), - base::SysNSStringToUTF16(tab.title), tab.url); + base::SysNSStringToUTF16(tab.title), + tab.lastCommittedURL); MDCSnackbarMessageAction* action = [[MDCSnackbarMessageAction alloc] init]; __weak BookmarkInteractionController* weakSelf = self; @@ -184,7 +185,8 @@ DCHECK(tab); const BookmarkNode* bookmark = - self.bookmarkModel->GetMostRecentlyAddedUserNodeForURL(tab.url); + self.bookmarkModel->GetMostRecentlyAddedUserNodeForURL( + tab.lastCommittedURL); if (!bookmark) return;
diff --git a/ios/chrome/browser/ui/first_run/first_run_egtest.mm b/ios/chrome/browser/ui/first_run/first_run_egtest.mm index 2a25294..cf6e70f 100644 --- a/ios/chrome/browser/ui/first_run/first_run_egtest.mm +++ b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
@@ -34,6 +34,11 @@ #error "This file requires ARC support." #endif +using chrome_test_util::AccountConsistencySetupSigninButton; +using chrome_test_util::ButtonWithAccessibilityLabel; +using chrome_test_util::ButtonWithAccessibilityLabelId; +using chrome_test_util::NavigationBarDoneButton; + namespace { // Returns a fake identity. @@ -43,11 +48,27 @@ name:@"Fake Foo"]; } -// Taps the button with accessibility labelId |message_id|. -void TapButtonWithLabelId(int message_id) { - id<GREYMatcher> matcher = chrome_test_util::ButtonWithAccessibilityLabel( - l10n_util::GetNSString(message_id)); - [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()]; +// Returns matcher for the opt in accept button. +id<GREYMatcher> FirstRunOptInAcceptButton() { + return ButtonWithAccessibilityLabel( + l10n_util::GetNSString(IDS_IOS_FIRSTRUN_OPT_IN_ACCEPT_BUTTON)); +} + +// Returns matcher for the skip sign in button. +id<GREYMatcher> SkipSigninButton() { + return grey_accessibilityID(kSignInSkipButtonAccessibilityIdentifier); +} + +// Returns matcher for the first run account consistency skip button. +id<GREYMatcher> FirstRunAccountConsistencySkipButton() { + return ButtonWithAccessibilityLabelId( + IDS_IOS_FIRSTRUN_ACCOUNT_CONSISTENCY_SKIP_BUTTON); +} + +// Returns matcher for the undo sign in button. +id<GREYMatcher> UndoAccountConsistencyButton() { + return ButtonWithAccessibilityLabelId( + IDS_IOS_ACCOUNT_CONSISTENCY_CONFIRMATION_UNDO_BUTTON); } // Asserts that |identity| is actually signed in to the active profile. @@ -135,9 +156,8 @@ grey_accessibilityID(kUMAMetricsButtonAccessibilityIdentifier); [[EarlGrey selectElementWithMatcher:metrics] performAction:grey_tap()]; - id<GREYMatcher> optInAccept = chrome_test_util::ButtonWithAccessibilityLabel( - l10n_util::GetNSString(IDS_IOS_FIRSTRUN_OPT_IN_ACCEPT_BUTTON)); - [[EarlGrey selectElementWithMatcher:optInAccept] performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:FirstRunOptInAcceptButton()] + performAction:grey_tap()]; BOOL metricsOptIn = GetApplicationContext()->GetLocalState()->GetBoolean( metrics::prefs::kMetricsReportingEnabled); @@ -150,9 +170,8 @@ - (void)testDismissFirstRun { [chrome_test_util::GetMainController() showFirstRunUI]; - id<GREYMatcher> optInAccept = chrome_test_util::ButtonWithAccessibilityLabel( - l10n_util::GetNSString(IDS_IOS_FIRSTRUN_OPT_IN_ACCEPT_BUTTON)); - [[EarlGrey selectElementWithMatcher:optInAccept] performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:FirstRunOptInAcceptButton()] + performAction:grey_tap()]; PrefService* preferences = GetApplicationContext()->GetLocalState(); GREYAssert( @@ -160,9 +179,8 @@ [WelcomeToChromeViewController defaultStatsCheckboxValue], @"Metrics reporting does not match."); - id<GREYMatcher> skipSignIn = - grey_accessibilityID(kSignInSkipButtonAccessibilityIdentifier); - [[EarlGrey selectElementWithMatcher:skipSignIn] performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:SkipSigninButton()] + performAction:grey_tap()]; id<GREYMatcher> newTab = grey_kindOfClass(NSClassFromString(@"NewTabPageView")); @@ -178,15 +196,20 @@ // Launch First Run and accept tems of services. [chrome_test_util::GetMainController() showFirstRunUI]; - TapButtonWithLabelId(IDS_IOS_FIRSTRUN_OPT_IN_ACCEPT_BUTTON); + [[EarlGrey selectElementWithMatcher:FirstRunOptInAcceptButton()] + performAction:grey_tap()]; // Sign In |identity|. - TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SIGNIN_BUTTON); + [[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()] + performAction:grey_tap()]; + AssertAuthenticatedIdentityInActiveProfile(identity); // Undo the sign-in and dismiss the Sign In screen. - TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_CONFIRMATION_UNDO_BUTTON); - TapButtonWithLabelId(IDS_IOS_FIRSTRUN_ACCOUNT_CONSISTENCY_SKIP_BUTTON); + [[EarlGrey selectElementWithMatcher:UndoAccountConsistencyButton()] + performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:FirstRunAccountConsistencySkipButton()] + performAction:grey_tap()]; // |identity| shouldn't be signed in. AssertAuthenticatedIdentityInActiveProfile(nil); @@ -200,10 +223,12 @@ // Launch First Run and accept tems of services. [chrome_test_util::GetMainController() showFirstRunUI]; - TapButtonWithLabelId(IDS_IOS_FIRSTRUN_OPT_IN_ACCEPT_BUTTON); + [[EarlGrey selectElementWithMatcher:FirstRunOptInAcceptButton()] + performAction:grey_tap()]; // Sign In |identity|. - TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SIGNIN_BUTTON); + [[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()] + performAction:grey_tap()]; AssertAuthenticatedIdentityInActiveProfile(identity); // Tap Settings link. @@ -219,7 +244,8 @@ @"Sync shouldn't have finished its original setup yet"); // Close Settings, user is still signed in and sync is now starting. - TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON); + [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] + performAction:grey_tap()]; AssertAuthenticatedIdentityInActiveProfile(identity); GREYAssertTrue(sync_service->HasFinishedInitialSetup(), @"Sync should have finished its original setup");
diff --git a/ios/chrome/browser/ui/main/browser_view_wrangler.mm b/ios/chrome/browser/ui/main/browser_view_wrangler.mm index 1ffdb49..537fa72 100644 --- a/ios/chrome/browser/ui/main/browser_view_wrangler.mm +++ b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
@@ -226,7 +226,7 @@ Tab* currentTab = [self.currentBVC tabModel].currentTab; // Set the active URL if there's a current tab and the current BVC is not OTR. if (currentTab && self.currentBVC != self.otrBVC) { - activeURL = currentTab.url; + activeURL = currentTab.visibleURL; } [self.deviceSharingManager updateActiveURL:activeURL]; }
diff --git a/ios/chrome/test/earl_grey/chrome_matchers.h b/ios/chrome/test/earl_grey/chrome_matchers.h index 910040f..a6432d8 100644 --- a/ios/chrome/test/earl_grey/chrome_matchers.h +++ b/ios/chrome/test/earl_grey/chrome_matchers.h
@@ -92,6 +92,9 @@ // Matcher for the done button on the navigation bar. id<GREYMatcher> NavigationBarDoneButton(); +// Returns matcher for the account consistency setup signin button. +id<GREYMatcher> AccountConsistencySetupSigninButton(); + } // namespace chrome_test_util #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_MATCHERS_H_
diff --git a/ios/chrome/test/earl_grey/chrome_matchers.mm b/ios/chrome/test/earl_grey/chrome_matchers.mm index 5d9ab5e..b5e56e49 100644 --- a/ios/chrome/test/earl_grey/chrome_matchers.mm +++ b/ios/chrome/test/earl_grey/chrome_matchers.mm
@@ -171,4 +171,9 @@ return ButtonWithAccessibilityLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON); } +id<GREYMatcher> AccountConsistencySetupSigninButton() { + return ButtonWithAccessibilityLabelId( + IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SIGNIN_BUTTON); +} + } // namespace chrome_test_util
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index a11db2c..fec250d 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -544,6 +544,9 @@ - (WKWebView*)webViewWithConfiguration:(WKWebViewConfiguration*)config; // Sets the value of the webView property, and performs its basic setup. - (void)setWebView:(WKWebView*)webView; +// Wraps the web view in a CRWWebViewContentView and adds it to the container +// view. +- (void)displayWebView; // Removes webView, optionally tracking the URL of the evicted // page for later cache-based reconstruction. - (void)removeWebViewAllowingCachedReconstruction:(BOOL)allowCache; @@ -4052,13 +4055,19 @@ _URLOnStartLoading = _defaultURL; - // Add the web toolbars. - [_containerView addToolbars:_webViewToolbars]; + // WKWebViews with invalid or empty frames have exhibited rendering bugs, so + // resize the view to match the container view upon creation. + [_webView setFrame:[_containerView bounds]]; - base::scoped_nsobject<CRWWebViewContentView> webViewContentView( - [[CRWWebViewContentView alloc] initWithWebView:_webView - scrollView:self.webScrollView]); - [_containerView displayWebViewContentView:webViewContentView]; + // If the visible NavigationItem should be loaded in this web view, display + // it immediately. Otherwise, it will be displayed when the pending load is + // committed. + web::NavigationItem* visibleItem = + self.navigationManagerImpl->GetVisibleItem(); + const GURL& visibleURL = + visibleItem ? visibleItem->GetURL() : GURL::EmptyGURL(); + if (![self shouldLoadURLInNativeView:visibleURL]) + [self displayWebView]; } } @@ -4111,6 +4120,19 @@ [self setDocumentURL:_defaultURL]; } +- (void)displayWebView { + if (!self.webView || [_containerView webViewContentView]) + return; + + // Add the web toolbars. + [_containerView addToolbars:_webViewToolbars]; + + base::scoped_nsobject<CRWWebViewContentView> webViewContentView( + [[CRWWebViewContentView alloc] initWithWebView:_webView + scrollView:self.webScrollView]); + [_containerView displayWebViewContentView:webViewContentView]; +} + - (void)removeWebViewAllowingCachedReconstruction:(BOOL)allowCache { if (!_webView) return; @@ -4523,6 +4545,9 @@ - (void)webView:(WKWebView*)webView didCommitNavigation:(WKNavigation*)navigation { + [self displayWebView]; + + // Record the navigation state. [_navigationStates setState:web::WKNavigationState::COMMITTED forNavigation:navigation]; @@ -4930,7 +4955,7 @@ } - (void)loadRequestForCurrentNavigationItem { - DCHECK(_webView && !self.nativeController); + DCHECK(_webView); DCHECK(self.currentNavItem); // If a load is kicked off on a WKWebView with a frame whose size is {0, 0} or // that has a negative dimension for a size, rendering issues occur that
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index 6df5157..3e3ac01 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -78,6 +78,9 @@ "test": "ipc_tests" }, { + "test": "latency_unittests" + }, + { "test": "media_unittests" }, { @@ -177,6 +180,9 @@ "test": "ipc_tests" }, { + "test": "latency_unittests" + }, + { "test": "media_unittests" }, { @@ -555,6 +561,21 @@ "test": "ipc_tests" }, { + "override_isolate_target": "latency_unittests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "device_os": "LMY47W", + "device_type": "sprout" + } + ], + "expiration": 14400 + }, + "test": "latency_unittests" + }, + { "override_isolate_target": "media_unittests", "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 8603b4d..5881722a 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -679,6 +679,37 @@ "test": "ipc_tests" }, { + "override_isolate_target": "latency_unittests", + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "4", + "device_os": "MMB29Q", + "device_type": "bullhead" + } + ], + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "latency_unittests" + }, + { "override_isolate_target": "media_unittests", "swarming": { "can_use_on_swarming_builders": true, @@ -1312,6 +1343,9 @@ "test": "ipc_tests" }, { + "test": "latency_unittests" + }, + { "test": "media_unittests" }, { @@ -1927,6 +1961,39 @@ "test": "ipc_tests" }, { + "override_isolate_target": "latency_unittests", + "swarming": { + "can_use_on_swarming_builders": true, + "cipd_packages": [ + { + "cipd_package": "infra/tools/luci/logdog/butler/${platform}", + "location": "bin", + "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" + } + ], + "dimension_sets": [ + { + "android_devices": "4", + "device_os": "LMY48I", + "device_type": "hammerhead" + } + ], + "expiration": 10800, + "hard_timeout": 960, + "output_links": [ + { + "link": [ + "https://luci-logdog.appspot.com/v/?s", + "=android%2Fswarming%2Flogcats%2F", + "${TASK_ID}%2F%2B%2Funified_logcats" + ], + "name": "shard #${SHARD_INDEX} logcats" + } + ] + }, + "test": "latency_unittests" + }, + { "override_isolate_target": "media_unittests", "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index dcef2a67..ee3acb5 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -43,6 +43,18 @@ "test": "ash_content_unittests" }, { + "args": [ + "--mus", + "--test-launcher-filter-file=../../testing/buildbot/filters/ash_mus_unittests.filter" + ], + "name": "ash_mus_unittests", + "override_isolate_target": "ash_unittests", + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "ash_unittests" + }, + { "swarming": { "can_use_on_swarming_builders": true }, @@ -228,6 +240,12 @@ "test": "jingle_unittests" }, { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "latency_unittests" + }, + { "args": [ "--ozone-platform=headless", "--override-use-software-gl-for-tests", @@ -668,6 +686,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, { @@ -1020,6 +1044,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, {
diff --git a/testing/buildbot/chromium.full.json b/testing/buildbot/chromium.full.json index aaee5cab..95777a6 100644 --- a/testing/buildbot/chromium.full.json +++ b/testing/buildbot/chromium.full.json
@@ -169,6 +169,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, { @@ -480,6 +486,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 6f9adea..5e6a766 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -119,6 +119,12 @@ "test": "ipc_tests" }, { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "latency_unittests" + }, + { "args": [ "--tool=asan" ], @@ -578,6 +584,12 @@ }, { "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "latency_unittests" + }, + { + "swarming": { "can_use_on_swarming_builders": false }, "test": "media_blink_unittests" @@ -955,6 +967,12 @@ }, { "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "latency_unittests" + }, + { + "swarming": { "can_use_on_swarming_builders": false }, "test": "media_blink_unittests"
diff --git a/testing/buildbot/chromium.memory.fyi.json b/testing/buildbot/chromium.memory.fyi.json index 830632d..2c53a73 100644 --- a/testing/buildbot/chromium.memory.fyi.json +++ b/testing/buildbot/chromium.memory.fyi.json
@@ -277,6 +277,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, { @@ -588,6 +594,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, { @@ -1544,6 +1556,9 @@ }, { "test": "keyboard_unittests" + }, + { + "test": "latency_unittests" } ] },
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index e206c3f..e73c1d63 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -465,6 +465,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, { @@ -761,6 +767,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, { @@ -1072,6 +1084,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, {
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index f77ce48..e555670 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -229,6 +229,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "libjingle_xmpp_unittests" }, { @@ -790,6 +796,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "libjingle_xmpp_unittests" }, { @@ -1267,6 +1279,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "libjingle_xmpp_unittests" }, { @@ -1712,6 +1730,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "latency_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "libjingle_xmpp_unittests" }, {
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 5ffb80a..19324c6 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -616,6 +616,10 @@ "label": "//ui/keyboard:keyboard_unittests", "type": "console_test_launcher", }, + "latency_unittests": { + "label": "//ui/latency:latency_unittests", + "type": "console_test_launcher", + }, "leveldb_service_unittests": { "label": "//components/leveldb:leveldb_service_unittests", "type": "console_test_launcher",
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls b/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls index 58f50cf..65a813b1 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls +++ b/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls
@@ -223,10 +223,6 @@ Bug(none) compositing/visibility/visibility-image-layers-dynamic.html [ Failure ] Bug(none) compositing/will-change/composited-layers.html [ Failure ] Bug(none) compositing/will-change/will-change-contents-suppresses-compositing.html [ Failure ] -Bug(none) css2.1/20110323/abspos-containing-block-initial-001.htm [ Failure ] -Bug(none) css2.1/20110323/replaced-intrinsic-001.htm [ Failure ] -Bug(none) css2.1/20110323/replaced-intrinsic-002.htm [ Failure ] -Bug(none) css2.1/20110323/replaced-intrinsic-ratio-001.htm [ Failure ] Bug(none) css3/blending/mix-blend-mode-2nd-stacking-context-composited.html [ Failure ] Bug(none) css3/blending/mix-blend-mode-composited-layers.html [ Failure ] Bug(none) css3/blending/mix-blend-mode-composited-reason-children.html [ Failure ] @@ -2211,7 +2207,6 @@ Bug(none) virtual/disable-spinvalidation/paint/invalidation/window-resize-viewport-percent.html [ Failure ] Bug(none) virtual/gpu-rasterization/images/color-profile-group.html [ Failure ] Bug(none) virtual/gpu-rasterization/images/color-profile-iframe.html [ Failure ] -Bug(none) virtual/layout_ng/css2.1/20110323/margin-applies-to-013.htm [ Failure ] Bug(none) virtual/mojo-loading/http/tests/misc/acid3.html [ Failure ] Bug(none) virtual/mojo-loading/http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm [ Failure ] Bug(none) virtual/mojo-loading/http/tests/navigation/anchor-frames-same-origin.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index ae2bddc4..5c5edb7 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -268,194 +268,6 @@ # ====== LayoutNG-only failures from here ====== # LayoutNG - is a new layout system for Blink. -#### css2.1/20110323 -#### Passed: 225 -#### Skipped: 184 -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-017.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-018.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-019.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-020.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-021.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-022.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-023.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-024.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-011.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-014.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-018.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-019.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-021.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-025.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-026.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-028.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-032.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-033.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-035.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-036.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-013.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-020.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-022.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-027.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-029.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-034.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-036.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-041.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-043.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-048.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-050.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-055.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-057.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-062.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-064.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-069.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-071.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-076.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-004c.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-004d.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-005b.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-005d.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-009a.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-non-replaced-width-margin-000.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-replaced-width-margin-000.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-010.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-011.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-013.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-014.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-016.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-width-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-collapse-offset-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/c541-word-sp-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/c543-txt-decor-000.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/empty-inline-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/empty-inline-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/empty-inline-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-009.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-010.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-011.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-011.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floating-replaced-height-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-001.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-102.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-149.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-001l.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-001r.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-001l.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-002l.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-002r.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-003l.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/height-applies-to-010a.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/height-percentage-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/height-width-inline-table-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-width-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-height-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-width-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-011.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-013.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-014.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-table-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-table-002a.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/list-style-position-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-010.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-014.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-027.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-013.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-014.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/max-height-percentage-003.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-009.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-010.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-elements-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-ratio-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-min-max-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-optional-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-height-algorithm-023.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-height-algorithm-024.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/text-indent-014.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/vertical-align-boxes-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/width-non-replaced-inline-001.htm [ Skip ] - #### fast/block/basic #### Passed: 5 #### Skipped: 27 @@ -1665,6 +1477,9 @@ crbug.com/501659 fast/css/stylesheet-candidate-nodes-crash.xhtml [ Failure ] crbug.com/501659 virtual/sharedarraybuffer/fast/css/stylesheet-candidate-nodes-crash.xhtml [ Failure ] +crbug.com/686470 http/tests/security/xss-DENIED-window-name-navigator.html [ Pass Failure ] +crbug.com/686470 virtual/mojo-loading/http/tests/security/xss-DENIED-window-name-navigator.html [ Pass Failure ] + # Mac10.10-specific failures that still need triaging. # Form controls need rebaseline because of the default font change. # If you see wider INPUT elements or narrower TEXTAREA elements, you may do just
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index 7c024e3..f018d97b 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -444,11 +444,6 @@ }, { "prefix": "layout_ng", - "base": "css2.1/20110323", - "args": ["--enable-blink-features=LayoutNG"] - }, - { - "prefix": "layout_ng", "base": "fast/block/float", "args": ["--enable-blink-features=LayoutNG"] },
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-001.htm deleted file mode 100644 index cc42c8a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-001.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, static position of fixed element</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The calculation of static position is based on initial containing block when there is a fixed positioned element."> - <style type="text/css"> - html, body, p - { - margin: 0; - padding: 0; - } - #div1 - { - border: solid black; - height: 2in; - position: absolute; - top: 1in; - width: 3in; - } - div div - { - background: blue; - height: 1in; - position: fixed; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes the a filled blue square touches the upper-left corner of the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-002.htm deleted file mode 100644 index dc8fa348..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-002.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, shrinks-to-fit height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The used value for absolutely positioned elements shrinks-to-fit height."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - bottom: auto; - color: blue; - font: 1in/1em Ahem; - height: auto; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box below is in the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-003.htm deleted file mode 100644 index c8cd32d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-003.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, vertical centering</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned non-replaced element's padding box (which is the area painted by background-color of the element) will be vertically centered within its containing block only if both 'margin-top' and 'margin-bottom' have equal values and if 'top' and 'bottom' have equal values. An absolutely positioned non-replaced element's margin box will be vertically centered within its containing block only if 'top' and 'bottom' have equal values."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 0.5in; - height: 1in; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: 0.5in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-004.htm deleted file mode 100644 index 78d17d3..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-004.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, 'margin-top' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'top', 'bottom', 'height' and 'margin-bottom' of an absolutely positioned, non-replaced element are all not 'auto' while its 'margin-top' is 'auto', then 'margin-top' becomes the remainder of the height of its containing block."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 0.5in; - height: 1in; - margin-top: auto; - margin-bottom: 0.5in; - position: absolute; - top: 0.5in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-005.htm deleted file mode 100644 index 5997aff8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-005.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, 'margin-bottom' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'top', 'bottom' and 'height' are all are not 'auto', 'margin-top' is not 'auto' and 'margin-bottom' is 'auto'. Then 'margin-bottom' becomes the remainder of the height of the containing box."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 0.5in; - height: 1in; - margin-bottom: auto; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-006.htm deleted file mode 100644 index d2fb110..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-006.htm +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, over-constrained</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The 'bottom' value is ignored and the equation solves for the bottom value, when the values for 'top', 'bottom', 'height', 'margin-top', 'margin-bottom' add up to more than the containing blocks height."> - <style type="text/css"> - #div1 - { - border: 10px solid black; - height: 300px; - position: relative; - width: 300px; - overflow: auto; - } - div div - { - background: blue; - height: 150px; - margin-bottom: 50px; - margin-top: 50px; - position: absolute; - top: 50px; - width: 50%; - } - #div2 - { - bottom: 50px; - } - #div3 - { - bottom: 0; - left: 50%; - } - </style> - </head> - <body> - <p>Test passes if there is one blue box on the page.</p> - <div id="div1"> - <div id="div2"></div> - <div id="div3"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-007.htm deleted file mode 100644 index 56e0e42a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-007.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, shrink-to-fit solve for top</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="Verify that height is based on the overall height of the content, 'margin-top', 'auto' is set to '0' and solve for 'top', when 'top' and 'height' are both 'auto' and 'bottom' is not 'auto'."> - <style type="text/css"> - #div1 - { - color: orange; - font: 1in/1em Ahem; - height: 4in; - position: relative; - width: 2in; - } - div div - { - background: blue; - bottom: 3in; - height: auto; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: auto; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the orange and blue boxes below are the same height.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-008.htm deleted file mode 100644 index 1206391..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-008.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, 'top' set to static position</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'top' is set to the static position and any 'auto' values for top and bottom margin are set to '0', when 'top' and 'bottom' are 'auto' and 'height' is not 'auto'."> - <style type="text/css"> - #div1 - { - background: blue; - height: 3in; - position: relative; - width: 1in; - } - div div - { - background: orange; - bottom: auto; - height: 1in; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: auto; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if there are two boxes below, a blue box below an orange box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-009.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-009.htm deleted file mode 100644 index 140f566..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-009.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, height is shrink-to-fit</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The 'height' is based on the content height, 'auto' values for 'margin-top' and 'margin-bottom' are set to '0' when 'height' and 'bottom' are 'auto' and 'top' is not 'auto'."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - background: blue; - bottom: auto; - color: orange; - font: 1in/1em Ahem; - height: auto; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: 0.25in; - width: 2in; - } - </style> - </head> - <body> - <p>Test passes if the orange and blue boxes below are the same height.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-010.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-010.htm deleted file mode 100644 index 27cf0317..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-010.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, 'margin-top' and 'margin-bottom' set to '0'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The 'auto' values for 'margin-top' and 'margin-bottom' are set to '0', when 'top' is 'auto' and 'height' and 'bottom' are not 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 1in; - height: 1in; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: auto; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-011.htm deleted file mode 100644 index 4901c0c6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-011.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, 'height' based on 'top' and 'bottom' positions</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The 'auto' values on 'margin-top', 'margin-bottom' are set to '0' and the 'height' is the remaining space between the 'top' and 'bottom' positions, when 'height' is 'auto' and 'top' and 'bottom' are both not 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 1in; - height: auto; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: 1in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-012.htm deleted file mode 100644 index e8c31c8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-height-012.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned, non-replaced elements, solve for 'bottom'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'margin-top' and 'margin-bottom' are set to '0' the 'bottom' value resolves to the remaining space within the containing block."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - position: absolute; - top: 1in; - bottom: auto; - height: 1in; - margin-top: auto; - margin-bottom: auto; - background: blue; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-001.htm deleted file mode 100644 index bdf2977..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-001.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, static position of fixed element</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The calculation of static position is based on initial containing block when there is a fixed positioned element."> - <style type="text/css"> - html, body, p - { - margin: 0; - padding: 0; - } - #div1 - { - border: solid black; - height: 2in; - position: absolute; - width: 2in; - } - div div - { - background: blue; - height: 1in; - max-height: 0.5in; - position: fixed; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-002.htm deleted file mode 100644 index a422a6ba..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-002.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'top', 'height', and 'bottom' of an absolutely positioned element are 'auto', then set 'top' to the static position and make 'height' based on the content; such height may be constrained by a given 'max-height' value."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: blue; - bottom: auto; - font: 1in/1em Ahem; - height: auto; - margin-bottom: auto; - margin-top: auto; - max-height: 0.5in; - position: absolute; - right: 0; - top: auto; - } - </style> - </head> - <body> - <p>Test passes if there is blue rectangle, and not a square, in the upper-right corner of the black box.</p> - <div id="div1"> - <div> </div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-003.htm deleted file mode 100644 index 09eec5d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-003.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, vertical centering</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned non-replaced element's padding box (which is the area painted by background-color of the element) will be vertically centered within its containing block only if both 'margin-top' and 'margin-bottom' have equal values and if 'top' and 'bottom' have equal values. An absolutely positioned non-replaced element's margin box will be vertically centered within its containing block only if 'top' and 'bottom' have equal values."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 0.5in; - height: 1in; - margin-bottom: auto; - margin-top: auto; - max-height: 0.5in; - position: absolute; - top: 0.5in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-004.htm deleted file mode 100644 index 064eddaa..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-004.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, 'margin-top' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'top', 'bottom' and 'height' are all are not 'auto', 'margin-top' is 'auto' and 'margin-bottom' is not 'auto'. Then 'margin-top' becomes the remainder of the height of the containing box."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 0.5in; - height: 2in; - margin-bottom: 0.5in; - margin-top: auto; - max-height: 1in; - position: absolute; - top: 0.5in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-005.htm deleted file mode 100644 index 9c7a9505..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-005.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, 'margin-bottom' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'top', 'bottom' and 'height' are all are not 'auto', 'margin-top' is not 'auto' and 'margin-bottom' is 'auto'. Then 'margin-bottom' becomes the remainder of the height of the containing box."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 0.5in; - height: 2in; - margin-bottom: auto; - margin-top: 0.5in; - max-height: 1in; - position: absolute; - top: 0.5in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-006.htm deleted file mode 100644 index 9c22c95..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-006.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, over-constrained</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The 'bottom' value is ignored and the equation solves for the bottom value, when the values for 'top', 'bottom', 'height', 'margin-top', 'margin-bottom' add up to more than the containing blocks height."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 0.5in; - height: 2in; - margin-bottom: 0.5in; - margin-top: 0.5in; - max-height: 1in; - position: absolute; - top: 0.5in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-007.htm deleted file mode 100644 index d83b899..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-007.htm +++ /dev/null
@@ -1,47 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, shrink-to-fit solve for top</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The height is based on the overall height of the content, 'margin-top', 'auto' is set to '0' and solve for 'top', when 'top' and 'height' are both 'auto' and 'bottom' is not 'auto'."> - <style type="text/css"> - #div1 - { - font: 1in/1em Ahem; - height: 4in; - position: relative; - width: 1in; - } - #div2 - { - background: orange; - height: 0.5in; - position: relative; - top: 0.5in; - width: 1in; - } - #div3 - { - background: blue; - bottom: 3in; - height: auto; - margin-bottom: auto; - margin-top: auto; - max-height: 0.5in; - position: absolute; - top: auto; - width: 0.5in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <div id="div2"></div> - <div id="div3"> </div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-008.htm deleted file mode 100644 index a61dfdc..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-008.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, 'top' set to static position</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'top' is set to the static position and any 'auto' values for top and bottom margin are set to '0', when 'top' and 'bottom' are 'auto' and 'height' is not 'auto'."> - <style type="text/css"> - #div1 - { - background: blue; - height: 3in; - position: relative; - width: 1in; - } - div div - { - background: orange; - bottom: auto; - height: 1in; - margin-bottom: auto; - margin-top: auto; - max-height: 0.5in; - position: absolute; - top: auto; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if there are two boxes below, a blue box below an orange box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-009.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-009.htm deleted file mode 100644 index 66aa2e1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-009.htm +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, height is shrink-to-fit</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The 'height' is based on the content height, 'auto' values for 'margin-top' and 'margin-bottom' are set to '0' when 'height' and 'bottom' are 'auto' and 'top' is not 'auto'."> - <style type="text/css"> - #div1 - { - position: relative; - } - #div2 - { - background: blue; - height: 0.5in; - left: 1in; - position: absolute; - top: 0.25in; - width: 1in; - } - #div3 - { - background: orange; - bottom: auto; - font: 1in/1em Ahem; - height: auto; - margin-bottom: auto; - margin-top: auto; - max-height: 0.5in; - position: absolute; - top: 0.25in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the orange and blue boxes below are the same height.</p> - <div id="div1"> - <div id="div2"></div> - <div id="div3"> </div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-010.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-010.htm deleted file mode 100644 index 986e4da..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-010.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, 'margin-top' and 'margin-bottom' set to '0'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The 'auto' values for 'margin-top' and 'margin-bottom' are set to '0', when 'top', 'height' and 'bottom' are all not auto."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 1in; - height: 2in; - margin-bottom: auto; - margin-top: auto; - max-height: 1in; - position: absolute; - top: auto; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-011.htm deleted file mode 100644 index c8a10667..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-011.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, 'height' based on 'top' and 'bottom' positions</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="The 'auto' values on 'margin-top', 'margin-bottom' are set to '0' and the 'height' is the remaining space between the 'top' and 'bottom' positions, when 'height' is 'auto' and 'top' and 'bottom' are both not 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: 1in; - height: auto; - margin-bottom: auto; - margin-top: auto; - max-height: 0.5in; - position: absolute; - top: 1in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-012.htm deleted file mode 100644 index 7834a82..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-max-height-012.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Max-height on absolutely positioned, non-replaced elements, solve for 'bottom'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="When 'margin-top' and 'margin-bottom' are set to '0' the 'bottom' value resolves to the remaining space within the containing block."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 3in; - } - div div - { - background: blue; - bottom: auto; - height: 2in; - margin-top: auto; - margin-bottom: auto; - max-height: 1in; - position: absolute; - top: 1in; - width: 100%; - } - </style> - </head> - <body> - <p>Test passes if the blue box is vertically centered in the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-001.htm deleted file mode 100644 index ff9bcf0a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-001.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving for 'right' on absolutely positioned non-replaced elements</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When direction is left-to-right and 'left', 'width' and 'right' are 'auto', the width becomes shrink-to-fit and then solve for 'right'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: auto; - position: absolute; - right: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-002.htm deleted file mode 100644 index 51bfe52..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-002.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving for 'left' on absolutely positioned non-replaced elements</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When direction is right-to-left and 'left', 'width' and 'right' are 'auto', the width becomes shrink-to-fit and then solve for 'left'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: auto; - position: absolute; - right: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-right corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-003.htm deleted file mode 100644 index ccb1a9e2..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-003.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced elements with 'margin-left' and 'margin-right' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'left', 'width' and 'right' are not 'auto', set 'margin-left' and 'margin-right' to equal values."> - <style type="text/css"> - #containingblock - { - border: solid black; - height: 2in; - position: relative; - width: 4in; - } - div div - { - /* left + margin-left + border-left-width + padding-left + width + padding-right + border-right-width + margin-right + right = width of containing block */ - /* 1in + solve + 0 + 0 + 1in + 0 + 0 + solve + -2in = 4in */ - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: auto; /* value is solved to 2in */ - margin-right: auto; /* value is solved to 2in */ - position: absolute; - right: -2in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue square in in the upper-right corner of the black rectangle and there is no red visible on the page.</p> - <div id="containingblock"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-004.htm deleted file mode 100644 index a9c346aa..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-004.htm +++ /dev/null
@@ -1,58 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced elements when both 'margin-left' and 'margin-right' are set to 'auto' and direction is left-to-right</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When direction is 'ltr' and 'left', 'width' and 'right' are not 'auto', solve for 'margin-right' and 'margin-left' to equal values. If this would make 'margin-left' and 'margin-right' negative, then set 'margin-left' to zero and solve for 'margin-right'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: auto; - margin-right: auto; - position: absolute; - right: 1in; - width: 1in; - } - /* - left : 1in - + margin-left : solve (auto) - + border-left-width : 0 - + padding-left : 0 - + width : 1in - + padding-right : 0 - + border-right-width : 0 - + margin-right : solve (auto) - + right : 1in - ==================================== - width of containing block : 2in - - So, margin-left and margin-right would be each -0.5in at this point. - - "...unless this would make them (the two margins) negative in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left')." - - So, under such extra constraint, 'margin-left' must become 0 and 'margin-right' must become -1in. - */ - </style> - </head> - <body> - <p>Test passes if the blue box fills the upper-right corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-005.htm deleted file mode 100644 index b88a3a60..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-005.htm +++ /dev/null
@@ -1,58 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced elements when both 'margin-left' and 'margin-right' are set to 'auto' and direction is right-to-left</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When direction is 'rtl' and 'left', 'width' and 'right' are not 'auto', solve for 'margin-right' and 'margin-left' to equal values. If this would make 'margin-left' and 'margin-right' negative, then set 'margin-right' to zero and solve for 'margin-left'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: auto; - margin-right: auto; - position: absolute; - right: 1in; - width: 1in; - } - /* - left : 1in - + margin-left : solve (auto) - + border-left-width : 0 - + padding-left : 0 - + width : 1in - + padding-right : 0 - + border-right-width : 0 - + margin-right : solve (auto) - + right : 1in - ==================================== - width of containing block : 2in - - So, margin-left and margin-right would be each -0.5in at this point. - - "...unless this would make them (the two margins) negative in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left')." - - So, under such extra constraint, 'margin-right' must become 0 and 'margin-left' must become -1in. - */ - </style> - </head> - <body> - <p>Test passes if the blue box fills the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-006.htm deleted file mode 100644 index 2aa9d559..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-006.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced element when only 'margin-right' is 'auto' and direction is left-to-right</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When direction is left-to-right and 'left', 'width', 'margin-left' and 'right' are not 'auto', solve for 'margin-right'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: 0.5in; - margin-left: 0.5in; - margin-right: auto; - position: absolute; - right: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-right corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-007.htm deleted file mode 100644 index 9b90b941..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-007.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced element when only 'margin-left' is 'auto' and direction is right-to-left</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When direction is right-to-left and 'left', 'width', 'margin-right' and 'right' are not 'auto', solve for 'margin-left'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: auto; - margin-right: 0.5in; - position: absolute; - right: 0.5in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-008.htm deleted file mode 100644 index 8d0427a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-008.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced elements with left, width, right and margin-right not auto</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="If 'left', 'width', 'right' and 'margin-right' are all not 'auto' and 'margin-left' is 'auto', then solve the equation for 'margin-left'."> - <style type="text/css"> - #containingblock - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 3in; - } - div div - { - /* left + margin-left + border-left-width + padding-left + width + padding-right + border-right-width + margin-right + right = width of containing block */ - /* 1in + solve + 0 + 0 + 1in + 0 + 0 + 1in + 1in = 3in */ - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: auto; /* value is solved to -1 */ - margin-right: 1in; - position: absolute; - right: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue square is in the upper-left corner of the black rectangle and there is no red visible on the page.</p> - <div id="containingblock"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-009.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-009.htm deleted file mode 100644 index 5f8c4e90..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-009.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced elements with left, width, right and margin-left not auto</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="If 'left', 'width', 'right' and 'margin-left' are all not 'auto' and 'margin-right' is 'auto', then solve the equation for 'margin-right'."> - <style type="text/css"> - #containingblock - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 3in; - } - div div - { - /* left + margin-left + border-left-width + padding-left + width + padding-right + border-right-width + margin-right + right = width of containing block */ - /* 1in + 1in + 0 + 0 + 1in + 0 + 0 + solve + 1in = 3in */ - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: 1in; - margin-right: auto; /* value is solved to -1 */ - position: absolute; - right: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue square is in the upper-right corner of the black rectangle and there is no red visible on the page.</p> - <div id="containingblock"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-010.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-010.htm deleted file mode 100644 index d99c7d8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-010.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solved for 'left' when absolutely positioned non-replaced elements has 'left' and 'width' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit and then solve for 'left'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: auto; - margin-left: auto; - margin-right: auto; - position: absolute; - right: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-011.htm deleted file mode 100644 index fe3fea6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-011.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced elements when 'left' and 'right' are 'auto', 'width' is not 'auto' and 'direction' is left-to-right</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'direction' is left-to-right and 'left' and 'right' are 'auto' and 'width' is not 'auto', solve for 'right'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: auto; - margin-left: auto; - margin-right: auto; - position: absolute; - right: auto; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-012.htm deleted file mode 100644 index 69292e9..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-012.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolutely positioned non-replaced elements when 'left' and 'right' are 'auto', 'width' is not 'auto' and 'direction' is right-to-left</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'direction' is right-to-left and 'left' and 'right' are 'auto' and 'width' is not 'auto', solve for 'left'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: auto; - margin-left: auto; - margin-right: auto; - position: absolute; - right: auto; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-right corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-013.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-013.htm deleted file mode 100644 index 5c322f2..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-013.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solved for 'right' when absolutely positioned non-replaced elements has 'right' and 'width' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'right' and 'width' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit and then solve for 'right'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: auto; - margin-right: auto; - position: absolute; - right: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-right corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-014.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-014.htm deleted file mode 100644 index 12a31ae..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-014.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solved for 'left' when absolutely positioned non-replaced elements has 'right' and 'width' not set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'left' is 'auto' and 'width' and 'right' are not 'auto' element solves for 'left'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: auto; - margin-left: auto; - margin-right: auto; - position: absolute; - right: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-015.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-015.htm deleted file mode 100644 index b048960..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-015.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solved for 'width' when absolutely positioned non-replaced elements has 'left' and 'right' not set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content=""> - <meta name="assert" content="When 'width' is 'auto' and 'left' and 'right' are not 'auto' element solves for 'width'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - position: relative; - width: 3in; - } - div div - { - background: blue; - left: 1in; - height: 1in; - margin-left: auto; - margin-right: auto; - position: absolute; - right: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box is horizontally centered inside black box and there is no red visible on the page.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-016.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-016.htm deleted file mode 100644 index 4d665717..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-016.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solved for 'right' when absolutely positioned non-replaced elements has 'left' and 'width' not set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'right' is 'auto' and 'width' and 'left' are not 'auto' element solves for 'right'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - position: relative; - width: 2in; - } - div div - { - background: red; - color: blue; - font: 1in/1em Ahem; - left: 1in; - margin-left: auto; - margin-right: auto; - position: absolute; - right: auto; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-right corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-017.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-017.htm deleted file mode 100644 index e6572713..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-017.htm +++ /dev/null
@@ -1,51 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (left-to-right), inline-block and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is left-to-right and 'left' is set to static position and 'width' and 'right' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to 'shrink-to-fit' width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: ltr; - margin: 8px; - } - - div - { - background-color: red; - font: 32px/4 Ahem; - left: auto; /* left is set to static position: it should be 8px from the left-hand side of document box (at body's margin-left) */ - position: absolute; - right: auto; - width: auto; - } - - span - { - background-color: green; - display: inline-block; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div><span>XXXXXXXX</span></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-018.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-018.htm deleted file mode 100644 index dc8dfe4..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-018.htm +++ /dev/null
@@ -1,53 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (left-to-right), inline-block and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is left-to-right and 'left' is set to static position and 'width' and 'right' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to shrink-to-fit width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: ltr; - margin: 8px; - } - - div#outer-abs-pos - { - background-color: red; - font: 32px/4 Ahem; - left: auto; /* left is set to static position: it should be 8px from the left-hand side of document box (at body's margin-left) */ - position: absolute; - right: auto; - width: auto; - } - - div#inner-inline-block - { - background-color: green; - display: inline-block; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div id="outer-abs-pos"> - <div id="inner-inline-block">XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-019.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-019.htm deleted file mode 100644 index fce368d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-019.htm +++ /dev/null
@@ -1,53 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (left-to-right), float and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is left-to-right and 'left' is set to static position and 'width' and 'right' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an floating, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to 'shrink-to-fit' width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: ltr; - margin: 8px; - } - - div#outer-abs-pos - { - background-color: red; - font: 32px/4 Ahem; - left: auto; /* left is set to static position: it should be 8px from the left-hand side of document box (at body's margin-left) */ - position: absolute; - right: auto; - width: auto; - } - - div#inner-floated - { - background-color: green; - float: left; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div id="outer-abs-pos"> - <div id="inner-floated">XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-020.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-020.htm deleted file mode 100644 index 14c17f68..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-020.htm +++ /dev/null
@@ -1,51 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (left-to-right), float and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is left-to-right and 'left' is set to static position and 'width' and 'right' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an floating, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to 'shrink-to-fit' width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: ltr; - margin: 8px; - } - - div - { - background-color: red; - font: 32px/4 Ahem; - left: auto; /* left is set to static position: it should be 8px from the left-hand side of document box (at body's margin-left) */ - position: absolute; - right: auto; - width: auto; - } - - span - { - background-color: green; - float: left; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div><span>XXXXXXXX</span></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-021.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-021.htm deleted file mode 100644 index 22f1dd8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-021.htm +++ /dev/null
@@ -1,53 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (right-to-left), inline-block and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is right-to-left and 'right' is set to static position and 'width' and 'left' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to 'shrink-to-fit' width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: rtl; - margin: 8px; - } - - p {direction: ltr;} - - div - { - background-color: red; - font: 32px/4 Ahem; - left: auto; - position: absolute; - right: auto; /* right is set to static position: it should be 8px from the right-hand side of document box (at body's margin-right) */ - width: auto; - } - - span - { - background-color: green; - display: inline-block; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below, on the right edge of the page, there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the left. There should be no red in this page.</p> - - <div><span>XXXXXXXX</span></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-022.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-022.htm deleted file mode 100644 index 43aa4d7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-022.htm +++ /dev/null
@@ -1,55 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (right-to-left), inline-block and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is right-to-left and 'right' is set to static position and 'width' and 'left' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to 'shrink-to-fit' width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: rtl; - margin: 8px; - } - - p {direction: ltr;} - - div#outer-abs-pos - { - background-color: red; - font: 32px/4 Ahem; - left: auto; - position: absolute; - right: auto; /* right is set to static position: it should be 8px from the right-hand side of document box (at body's margin-right) */ - width: auto; - } - - div#inner-inline-block - { - background-color: green; - display: inline-block; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below, on the right edge of the page, there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the left. There should be no red in this page.</p> - - <div id="outer-abs-pos"> - <div id="inner-inline-block">XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-023.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-023.htm deleted file mode 100644 index a9d352dd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-023.htm +++ /dev/null
@@ -1,55 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (right-to-left), float and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is right-to-left and 'right' is set to static position and 'width' and 'left' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an floating, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to 'shrink-to-fit' width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: rtl; - margin: 8px; - } - - p {direction: ltr;} - - div#outer-abs-pos - { - background-color: red; - font: 32px/4 Ahem; - left: auto; - position: absolute; - right: auto; /* right is set to static position: it should be 8px from the right-hand side of document box (at body's margin-right) */ - width: auto; - } - - div#inner-floated - { - background-color: green; - float: left; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below, on the right edge of the page, there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the left. There should be no red in this page.</p> - - <div id="outer-abs-pos"> - <div id="inner-floated">XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-024.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-024.htm deleted file mode 100644 index 47e01875..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-non-replaced-width-024.htm +++ /dev/null
@@ -1,53 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of absolutely positioned, non-replaced elements - direction (right-to-left), float and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.7 Absolutely positioned, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="When direction is right-to-left and 'right' is set to static position and 'width' and 'left' are 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an floating, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is also given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If width of an absolutely positioned, non-replaced element resorts to 'shrink-to-fit' width calculation but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - body - { - direction: rtl; - margin: 8px; - } - - p {direction: ltr;} - - div - { - background-color: red; - font: 32px/4 Ahem; - left: auto; - position: absolute; - right: auto; /* right is set to static position: it should be 8px from the right-hand side of document box (at body's margin-right) */ - width: auto; - } - - span - { - background-color: green; - float: left; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below, on the right edge of the page, there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the left. There should be no red in this page.</p> - - <div><span>XXXXXXXX</span></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-001.htm deleted file mode 100644 index 4066d35..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-001.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'margin-top' and 'margin-bottom' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="An absolutely positioned replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'."> - <style type="text/css"> - div - { - border-bottom: solid orange; - border-top: solid orange; - height: 15px; - line-height: 0; - width: 1in; - } - img - { - margin-bottom: auto; - margin-top: auto; - position: absolute; - } - </style> - </head> - <body> - <p>Test passes if there is no white space between the blue box below and the orange lines.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-002.htm deleted file mode 100644 index 8d3cbfe..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-002.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements relying on intrinsic height dimensions</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an absolutely positioned replaced element with and intrinsic height has a 'height' and 'width' computed as 'auto'."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 15px; - left: 15px; - position: absolute; - top: 0; - width: 15px; - } - img - { - height: auto; - position: absolute; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-003.htm deleted file mode 100644 index 40781b41..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-003.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an absolutely positioned replaced element has an intrinsic ratio, 'height' is set to 'auto' and 'width' is specified."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 1in; - left: 1in; - position: absolute; - top: 0; - } - img - { - height: auto; - position: absolute; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-004.htm deleted file mode 100644 index 21e7087..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-004.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements without intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For an absolutely positioned replaced element the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - height: auto; - position: absolute; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-005.htm deleted file mode 100644 index 03625ba..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-005.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - position: absolute; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-007.htm deleted file mode 100644 index 061e4f0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-007.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height that cannot be resolved</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - position: absolute; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-008.htm deleted file mode 100644 index 0528002..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-008.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'margin-top', 'margin-bottom' and 'bottom' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="An absolutely positioned replaced elements' used value of 'bottom', 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - img - { - bottom: auto; - margin-bottom: auto; - margin-top: auto; - position: absolute; - top: 1in; - } - div div - { - background: blue; - height: 15px; - left: 15px; - position: relative; - top: 1in; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-009.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-009.htm deleted file mode 100644 index 2d7ec01..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-009.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements relying on intrinsic height dimensions and 'bottom' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an absolutely positioned replaced element with and intrinsic height has a 'height', 'width' and 'bottom' computed as 'auto'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 15px; - left: 15px; - position: absolute; - top: 1in; - width: 15px; - } - img - { - bottom: auto; - height: auto; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-010.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-010.htm deleted file mode 100644 index 6a20600..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-010.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with intrinsic ratios, 'height' and 'bottom' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an absolutely positioned replaced element has an intrinsic ratio, 'height' and 'bottom' are set to 'auto' and 'width' is specified."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 1in; - left: 1in; - position: absolute; - top: 1in; - } - img - { - bottom: auto; - height: auto; - position: absolute; - top: 1in; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-011.htm deleted file mode 100644 index c5636bd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-011.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements without intrinsic ratios, 'height' and 'bottom' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For an absolutely positioned replaced element the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: auto; - height: auto; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-012.htm deleted file mode 100644 index 38618625..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-012.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height and 'bottom' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: auto; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-014.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-014.htm deleted file mode 100644 index 352b3cf..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-014.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height that cannot be resolved and 'top' specified</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: auto; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-016.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-016.htm deleted file mode 100644 index 0e17fed..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-016.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements relying on intrinsic height dimensions and 'top', 'bottom' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an absolutely positioned replaced element with and intrinsic height has a 'height', 'width' computed as 'auto' and 'top', 'bottom' are not 'auto'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 15px; - left: 15px; - position: absolute; - top: 1in; - width: 15px; - } - img - { - bottom: 1in; - height: auto; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-017.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-017.htm deleted file mode 100644 index 64e6d6b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-017.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with intrinsic ratios, 'height' set to 'auto' and 'top', 'bottom' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an absolutely positioned replaced element has an intrinsic ratio, 'height' is set to 'auto', 'width' is specified and 'top', 'bottom' are not 'auto'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 1in; - left: 1in; - position: absolute; - top: 1in; - } - img - { - bottom: 1in; - height: auto; - position: absolute; - top: 1in; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-018.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-018.htm deleted file mode 100644 index 3016686f8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-018.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements without intrinsic ratios, 'height' set to 'auto' and 'top', 'bottom' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For an absolutely positioned replaced element the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - height: auto; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-019.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-019.htm deleted file mode 100644 index 1954530..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-019.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height set to 'auto' and 'top', 'bottom' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-021.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-021.htm deleted file mode 100644 index 99007a4..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-021.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height that cannot be resolved where 'top' and 'bottom' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - position: absolute; - top: 1in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-022.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-022.htm deleted file mode 100644 index 934b8f1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-022.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'margin-bottom' as 'auto' and 'top', 'bottom', 'margin-top' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="An absolutely positioned replaced element with only one value as 'auto' solves for that value (margin-bottom)."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - img - { - bottom: 1in; - margin-bottom: auto; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - } - div div - { - background: blue; - height: 15px; - left: 15px; - position: relative; - top: 1in; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-023.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-023.htm deleted file mode 100644 index 26132a2..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-023.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements relying on intrinsic height dimensions and 'top', 'bottom', 'margin-top' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an absolutely positioned replaced element with and intrinsic height has a 'height', 'width' computed as 'auto' and 'top', 'bottom' are not 'auto'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 15px; - left: 15px; - position: absolute; - top: 1in; - width: 15px; - } - img - { - bottom: 1in; - height: auto; - margin-bottom: auto; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-024.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-024.htm deleted file mode 100644 index caa433e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-024.htm +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with intrinsic ratios, 'height' set to 'auto' and 'top', 'bottom', 'margin-top' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an absolutely positioned replaced element has an intrinsic ratio, 'height' is set to 'auto', 'width' is specified and 'top', 'bottom' are not 'auto'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 1in; - left: 1in; - position: absolute; - top: 1in; - } - img - { - bottom: 1in; - height: auto; - margin-bottom: auto; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-025.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-025.htm deleted file mode 100644 index fcbf7c4..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-025.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements without intrinsic ratios, 'height' set to 'auto' and 'top', 'bottom', 'margin-top' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For an absolutely positioned replaced element the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - height: auto; - margin-bottom: auto; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-026.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-026.htm deleted file mode 100644 index eca9dbd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-026.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height set to 'auto' and 'top', 'bottom', 'margin-top' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - margin-bottom: auto; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-028.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-028.htm deleted file mode 100644 index a066491..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-028.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height that cannot be resolved where 'top', 'bottom', 'margin-top' are not 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - margin-bottom: auto; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-029.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-029.htm deleted file mode 100644 index 913604b4..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-029.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with over-constrained values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="An absolutely positioned replaced element with over-constrained values solves for 'bottom'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - img - { - bottom: 0.5in; - margin-bottom: 0.5in; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - } - div div - { - background: blue; - height: 15px; - left: 15px; - position: relative; - top: 1in; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-030.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-030.htm deleted file mode 100644 index 7dbeb05..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-030.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements relying on intrinsic height dimensions and over-constrained values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an absolutely positioned replaced element with and intrinsic height with over-constrained values solves for 'bottom'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 15px; - left: 15px; - position: absolute; - top: 1in; - width: 15px; - } - img - { - bottom: 1in; - height: auto; - margin-bottom: 0.5in; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-031.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-031.htm deleted file mode 100644 index 6576289..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-031.htm +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with intrinsic ratios, 'height' set to 'auto' and over-constrained values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an absolutely positioned replaced element has an intrinsic ratio, 'height' is set to 'auto', with over-constrained values solves for 'bottom'."> - <style type="text/css"> - #div1 - { - border-top: solid black; - position: relative; - } - div div - { - background: blue; - height: 1in; - left: 1in; - position: absolute; - top: 1in; - } - img - { - bottom: 1in; - height: auto; - margin-bottom: 0.5in; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is a single blue box below and it does not touch the black line.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-032.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-032.htm deleted file mode 100644 index 91f4d7f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-032.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements without intrinsic ratios, 'height' set to 'auto' and over-constrained values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For an absolutely positioned replaced element the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width. And with over-constrained values element solves for 'bottom'."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - height: auto; - margin-bottom: 0.5in; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-033.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-033.htm deleted file mode 100644 index ab0e7470..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-033.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height set to 'auto' and over-constrained values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - margin-bottom: 0.5in; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-035.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-035.htm deleted file mode 100644 index c2483c4..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-035.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with percentage based intrinsic height that cannot be resolved and there are over-constrained values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned replaced element with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - position: absolute; - top: 1in; - width: 300px; - } - iframe - { - border: solid red; - bottom: 1in; - margin-bottom: 0.5in; - margin-top: 0.5in; - position: absolute; - top: 0.5in; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-036.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-036.htm deleted file mode 100644 index 0920f56..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-height-036.htm +++ /dev/null
@@ -1,61 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute Replaced Elements: specified 'top' and 'bottom' with auto margins</title> - <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visufx.html#clipping"> - <meta name="flags" content="image"> - <meta name="assert" content="If 'top' and 'bottom' are specified on an absolutely-positioned replaced element, then any remaining space is split amongst the 'auto' vertical margins."> - <style type="text/css"> - .container { - position: relative; - width: 45px; - height: 45px; - /* Uncomment for debugging: - border: solid silver; - background: aqua; */ - } - .abspos { - position: absolute; - top: 0; bottom: 0; - background: red; - } - .one { - margin: auto; - left: 0; - } - .two { - margin-top: auto; - left: 15px; - } - .three { - margin-bottom: auto; - right: 0; - } - .control1 { - height: 15px; - border-right: 15px solid red; - } - .control2 { - height: 15px; - border-left: 15px solid red; - } - .control3 { - height: 15px; - margin: 0 15px; - background: red; - } - </style> - </head> - <body> - <p>There must be no red.</p> - <div class="container"> - <img class="abspos one" src="resources/swatch-white.png" alt="FAIL: image support required"> - <img class="abspos two" src="resources/swatch-white.png" alt="FAIL: image support required"> - <img class="abspos three" src="resources/swatch-white.png" alt="FAIL: image support required"> - <div class="control1"></div> - <div class="control2"></div> - <div class="control3"></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-001.htm deleted file mode 100644 index c49ef0f7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-001.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements and 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - position: absolute; - } - div div - { - background: orange; - height: 15px; - margin-top: 15px; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-006.htm deleted file mode 100644 index 79a7d307..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-006.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements and 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - position: absolute; - } - div div - { - background: orange; - height: 1in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-008.htm deleted file mode 100644 index 14e9ebc..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-008.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-left', 'margin-right', 'left', 'right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: auto; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 15px; - margin-top: 15px; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-013.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-013.htm deleted file mode 100644 index 104abbf..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-013.htm +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-left', 'margin-right', 'left', 'right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: ltr; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: auto; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 1in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-015.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-015.htm deleted file mode 100644 index 8e600312..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-015.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-left', 'margin-right', 'left', 'right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: auto; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 15px; - margin-top: 15px; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-020.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-020.htm deleted file mode 100644 index ff194e1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-020.htm +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-left', 'margin-right', 'left', 'right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: rtl; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: auto; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 1in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-022.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-022.htm deleted file mode 100644 index fef7407..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-022.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-left', 'margin-right', 'right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 1in; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 96px; - margin-left: 1in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-027.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-027.htm deleted file mode 100644 index 3472b2f6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-027.htm +++ /dev/null
@@ -1,47 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-left', 'margin-right', 'right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: ltr; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 1in; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 1in; - margin-left: 1in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-029.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-029.htm deleted file mode 100644 index f2c2b08a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-029.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-left', 'margin-right', 'right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 1in; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 96px; - margin-left: 1in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-034.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-034.htm deleted file mode 100644 index 35dba16..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-034.htm +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-left', 'margin-right', 'right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: rtl; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 1in; - position: absolute; - right: auto; - } - div div - { - background: orange; - height: 1in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-036.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-036.htm deleted file mode 100644 index d60f10e7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-036.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 0.5in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 96px; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-041.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-041.htm deleted file mode 100644 index 3e3e4f5..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-041.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: ltr; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 0.5in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 1in; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-043.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-043.htm deleted file mode 100644 index 0e0b07f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-043.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 0.5in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 96px; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-048.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-048.htm deleted file mode 100644 index 382a40c..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-048.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: rtl; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - left: 0.5in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 1in; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-050.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-050.htm deleted file mode 100644 index 859ed72f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-050.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - img - { - margin-left: 0.25in; - margin-right: auto; - left: 0.25in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 96px; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-055.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-055.htm deleted file mode 100644 index a97ac561..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-055.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, 'auto' specified for 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: ltr; - height: 3in; - position: relative; - width: 2in; - } - img - { - margin-left: 0.25in; - margin-right: auto; - left: 0.25in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 1in; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-057.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-057.htm deleted file mode 100644 index f479c19..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-057.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - img - { - left: 0.25in; - margin-left: 0.25in; - margin-right: auto; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 96px; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-062.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-062.htm deleted file mode 100644 index 16e5bba..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-062.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, 'auto' specified for 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: rtl; - height: 3in; - position: relative; - width: 2in; - } - img - { - left: 0.25in; - margin-left: 0.25in; - margin-right: auto; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 1in; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-064.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-064.htm deleted file mode 100644 index 1512b4a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-064.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, intrinsic width and over-constrained situation</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: ltr; - height: 2in; - position: relative; - width: 2in; - } - img - { - left: 0.25in; - margin-left: 0.25in; - margin-right: 0.5in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 96px; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-069.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-069.htm deleted file mode 100644 index ce1bf25f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-069.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as left-to-right, percentage intrinsic width and over-constrained situation</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: ltr; - height: 3in; - position: relative; - width: 2in; - } - img - { - left: 0.25in; - margin-left: 0.25in; - margin-right: 0.5in; - position: absolute; - right: 0.5in; - } - div div - { - background: orange; - height: 1in; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-071.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-071.htm deleted file mode 100644 index 0c36b9f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-071.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, intrinsic width and over-constrained situation</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on absolute replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - direction: rtl; - height: 2in; - position: relative; - width: 2in; - } - img - { - left: 0.5in; - margin-left: 0.5in; - margin-right: 0.25in; - position: absolute; - right: 0.25in; - } - div div - { - background: orange; - height: 96px; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-076.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-076.htm deleted file mode 100644 index 9fe4a64..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/absolute-replaced-width-076.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Absolute replaced elements with 'direction' as right-to-left, percentage intrinsic width and over-constrained situation</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - direction: rtl; - height: 3in; - position: relative; - width: 2in; - } - img - { - left: 0.5in; - margin-left: 0.5in; - margin-right: 0.25in; - position: absolute; - right: 0.25in; - } - div div - { - background: orange; - height: 1in; - margin-left: 0.5in; - margin-right: 0.5in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the boxes are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-expected.txt deleted file mode 100644 index 8fd0455..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollY 50.00 scrollHeight 10120 - LayoutView at (0,0) size 800x600 -layer at (10,10) size 765x10100 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 - LayoutBlockFlow {HTML} at (10,10) size 765x10100 [border: (20px solid #000000)] - LayoutBlockFlow {BODY} at (50,50) size 665x10000 -layer at (60,0) size 100x100 - LayoutBlockFlow (positioned) {DIV} at (60,0) size 100x100 [bgcolor=#FFFF00] -layer at (685,60) size 100x100 - LayoutBlockFlow (positioned) {DIV} at (685,60) size 100x100 [bgcolor=#FFA500] -layer at (60,500) size 100x100 - LayoutBlockFlow (positioned) {DIV} at (60,500) size 100x100 [bgcolor=#A52A2A] -layer at (0,60) size 100x100 - LayoutBlockFlow (positioned) {DIV} at (0,60) size 100x100 [bgcolor=#FFC0CB] -scrolled to 0,50
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-ref-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-ref-expected.png deleted file mode 100644 index 298bdd7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-ref-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-ref.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-ref.htm deleted file mode 100644 index 3374457..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001-ref.htm +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> -body { margin:0; } -.pos { position:absolute; width:100px; height:100px; } -</style> -</head> -<body> -<div style="height:10000px; margin:0; margin:10px; border:20px solid black; padding:30px;"></div> -<script type="text/javascript"> -window.scrollTo(0,50); -</script> -<div style="top:0; left:60px; background:yellow;" class="pos"></div> -<div style="right:0; top:60px; background:orange;" class="pos"></div> -<div style="bottom:0; left:60px; background:brown;" class="pos"></div> -<div style="left:0; top:60px; background:pink;" class="pos"></div> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001.htm deleted file mode 100644 index ba548cc..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-001.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-001-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content="dom"> -<style type="text/css"> -html { margin:10px; border:20px solid black; padding:30px; } -body { height:10000px; margin:0; } -div { position:absolute; width:100px; height:100px; } -</style> -</head> -<body> -<script type="text/javascript"> -window.scrollTo(0,50); -</script> -<div style="top:0; background:yellow;"></div> -<div style="right:0; background:orange;"></div> -<div style="bottom:0; background:brown;"></div> -<div style="left:0; background:pink;"></div> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref-expected.png deleted file mode 100644 index 9437aec0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref-expected.txt deleted file mode 100644 index 0b7fdc8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x8 - LayoutBlockFlow {HTML} at (0,0) size 800x8 [bgcolor=#FFFF00] - LayoutBlockFlow {BODY} at (8,8) size 784x0 -layer at (100,100) size 120x120 - LayoutBlockFlow (positioned) {DIV} at (100,100) size 120x120 [border: (10px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref.htm deleted file mode 100644 index d5ec9a8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004-ref.htm +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="background:yellow;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -</head><body> -<div style="position:absolute; top:100px; left:100px; width:100px; height:100px; border:10px solid black;"></div> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a-expected.png deleted file mode 100644 index 9437aec0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a-expected.txt deleted file mode 100644 index 126472e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (100,100) size 120x120 - LayoutBlockFlow (positioned) {HTML} at (100,100) size 120x120 [border: (10px solid #000000)] - LayoutBlockFlow {BODY} at (18,18) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a.htm deleted file mode 100644 index 5a33f55..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004a.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:absolute; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-004-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b-expected.png deleted file mode 100644 index 9437aec0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b-expected.txt deleted file mode 100644 index 126472e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (100,100) size 120x120 - LayoutBlockFlow (positioned) {HTML} at (100,100) size 120x120 [border: (10px solid #000000)] - LayoutBlockFlow {BODY} at (18,18) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b.htm deleted file mode 100644 index 6896c92..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004b.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:fixed; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-004-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c-expected.png deleted file mode 100644 index 9437aec0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c-expected.txt deleted file mode 100644 index 90934b24..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (100,100) size 120x120 - LayoutTable (positioned) {HTML} at (100,100) size 120x120 [border: (10px solid #000000)] - LayoutTableSection (anonymous) at (10,10) size 100x100 - LayoutTableRow (anonymous) at (0,0) size 100x100 - LayoutTableCell (anonymous) at (0,0) size 100x8 [r=0 c=0 rs=1 cs=1] - LayoutBlockFlow {BODY} at (8,8) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c.htm deleted file mode 100644 index 3d897c1c..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004c.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:absolute; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black; display:table;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-004-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d-expected.png deleted file mode 100644 index 9437aec0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d-expected.txt deleted file mode 100644 index 90934b24..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (100,100) size 120x120 - LayoutTable (positioned) {HTML} at (100,100) size 120x120 [border: (10px solid #000000)] - LayoutTableSection (anonymous) at (10,10) size 100x100 - LayoutTableRow (anonymous) at (0,0) size 100x100 - LayoutTableCell (anonymous) at (0,0) size 100x8 [r=0 c=0 rs=1 cs=1] - LayoutBlockFlow {BODY} at (8,8) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d.htm deleted file mode 100644 index 8274d55..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:fixed; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black; display:table"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-004-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d.htm.1 b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d.htm.1 deleted file mode 100644 index 8274d55..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004d.htm.1 +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:fixed; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black; display:table"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-004-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e-expected.png deleted file mode 100644 index 9437aec0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e-expected.txt deleted file mode 100644 index 9d4f104d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 0x0 - LayoutTable {HTML} at (0,0) size 0x0 - LayoutTableSection (anonymous) at (0,0) size 0x0 - LayoutTableRow (anonymous) at (0,0) size 0x0 - LayoutTableCell (anonymous) at (0,0) size 0x0 [r=0 c=0 rs=1 cs=1] -layer at (100,100) size 120x120 - LayoutBlockFlow (positioned) {BODY} at (100,100) size 120x120 [bgcolor=#FFFF00] [border: (10px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e.htm deleted file mode 100644 index f7b626a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004e.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="display:table"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-004-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body style="position:absolute; left:100px; top:100px; width:100px; height:100px; border:10px solid black; background:yellow; margin:0"> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f-expected.png deleted file mode 100644 index 9437aec0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f-expected.txt deleted file mode 100644 index 9d4f104d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 0x0 - LayoutTable {HTML} at (0,0) size 0x0 - LayoutTableSection (anonymous) at (0,0) size 0x0 - LayoutTableRow (anonymous) at (0,0) size 0x0 - LayoutTableCell (anonymous) at (0,0) size 0x0 [r=0 c=0 rs=1 cs=1] -layer at (100,100) size 120x120 - LayoutBlockFlow (positioned) {BODY} at (100,100) size 120x120 [bgcolor=#FFFF00] [border: (10px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f.htm deleted file mode 100644 index 54ce5a8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-004f.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="display:table"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-004-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body style="position:fixed; left:100px; top:100px; width:100px; height:100px; border:10px solid black; background:yellow; margin:0"> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref-expected.png deleted file mode 100644 index 590d85b1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref-expected.txt deleted file mode 100644 index 9f2c439..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x120 - LayoutBlockFlow {HTML} at (0,0) size 800x120 [bgcolor=#FFFF00] - LayoutBlockFlow {BODY} at (0,0) size 800x120 - LayoutBlockFlow {DIV} at (0,0) size 120x120 [border: (10px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref.htm deleted file mode 100644 index 12457f6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005-ref.htm +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="background:yellow;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -</head><body style="margin:0"> -<div style="border:10px solid black; width:100px; height:100px;"></div> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a-expected.png deleted file mode 100644 index 590d85b1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a-expected.txt deleted file mode 100644 index a8ff7a0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 120x120 - LayoutBlockFlow (positioned) {HTML} at (0,0) size 120x120 [border: (10px solid #000000)] - LayoutBlockFlow {BODY} at (18,18) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a.htm deleted file mode 100644 index be9b0ab..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005a.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:absolute; width:100px; height:100px; background:yellow; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-005-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b-expected.png deleted file mode 100644 index 590d85b1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b-expected.txt deleted file mode 100644 index 2f448f8e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 120x120 - LayoutTable (positioned) {HTML} at (0,0) size 120x120 [border: (10px solid #000000)] - LayoutTableSection (anonymous) at (10,10) size 100x100 - LayoutTableRow (anonymous) at (0,0) size 100x100 - LayoutTableCell (anonymous) at (0,0) size 100x8 [r=0 c=0 rs=1 cs=1] - LayoutBlockFlow {BODY} at (8,8) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b.htm deleted file mode 100644 index 3ef71f5c..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005b.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:absolute; width:100px; height:100px; display:table; background:yellow; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-005-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c-expected.png deleted file mode 100644 index 590d85b1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c-expected.txt deleted file mode 100644 index a8ff7a0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 120x120 - LayoutBlockFlow (positioned) {HTML} at (0,0) size 120x120 [border: (10px solid #000000)] - LayoutBlockFlow {BODY} at (18,18) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c.htm deleted file mode 100644 index a075263d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005c.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:fixed; width:100px; height:100px; background:yellow; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-005-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d-expected.png deleted file mode 100644 index 590d85b1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d-expected.txt deleted file mode 100644 index 2f448f8e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 120x120 - LayoutTable (positioned) {HTML} at (0,0) size 120x120 [border: (10px solid #000000)] - LayoutTableSection (anonymous) at (10,10) size 100x100 - LayoutTableRow (anonymous) at (0,0) size 100x100 - LayoutTableCell (anonymous) at (0,0) size 100x8 [r=0 c=0 rs=1 cs=1] - LayoutBlockFlow {BODY} at (8,8) size 84x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d.htm deleted file mode 100644 index f3f6304b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-005d.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:fixed; width:100px; height:100px; display:table; background:yellow; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-005-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-expected.txt deleted file mode 100644 index 4cb35a1f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -layer at (0,0) size 800x600 scrollWidth 900 - LayoutView at (0,0) size 800x600 -layer at (100,100) size 800x120 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 - LayoutBlockFlow (relative positioned) {HTML} at (0,0) size 800x120 [border: (10px solid #000000)] -layer at (110,160) size 20x50 - LayoutBlockFlow (positioned) {BODY} at (10,60) size 20x50 [border: (10px solid #FFA500)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref-expected.png deleted file mode 100644 index b590eb3..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref-expected.txt deleted file mode 100644 index 7c81ce85..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -layer at (0,0) size 900x584 - LayoutView at (0,0) size 800x584 -layer at (0,0) size 800x120 - LayoutBlockFlow {HTML} at (0,0) size 800x120 - LayoutBlockFlow (positioned) {BODY} at (0,0) size 800x120 -layer at (100,100) size 800x120 - LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 800x120 [border: (10px solid #000000)] -layer at (110,160) size 20x50 - LayoutBlockFlow (positioned) {DIV} at (10,60) size 20x50 [border: (10px solid #FFA500)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref.htm deleted file mode 100644 index b499898..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007-ref.htm +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -</head><body style="margin:0;"> -<div style="position:relative; top:100px; left:100px; height:100px; border:10px solid black;"> - <div style="position:absolute; bottom:0; height:30px; border:10px solid orange;"> - </div> - - -</div></body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007.htm deleted file mode 100644 index 2c2cce9..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-007.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:relative; top:100px; left:100px; height:100px; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-007-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body style="position:absolute; margin:0; bottom:0; height:30px; border:10px solid orange;overflow:hidden;"> - - -</body></html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref-expected.png deleted file mode 100644 index 34ffc176..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref-expected.txt deleted file mode 100644 index 68a6f9d0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x0 - LayoutBlockFlow {HTML} at (0,0) size 800x0 - LayoutBlockFlow {BODY} at (0,0) size 800x0 -layer at (50,50) size 420x320 - LayoutBlockFlow (positioned) {DIV} at (50,50) size 420x320 [border: (10px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref.htm deleted file mode 100644 index 599de93..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009-ref.htm +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -</head><body style="margin:0"> -<div style="position:fixed; width:50%; height:50%; left:50px; top:50px; border:10px solid black;"></div> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a-expected.png deleted file mode 100644 index 34ffc176..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a-expected.txt deleted file mode 100644 index 9f7eb90d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (50,50) size 420x320 - LayoutBlockFlow {HTML} at (50,50) size 420x320 [border: (10px solid #000000)] - LayoutBlockFlow {BODY} at (18,18) size 384x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a.htm deleted file mode 100644 index 47c825a2..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009a.htm +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="width:50%; height:50%; margin:50px; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-009-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b-expected.png deleted file mode 100644 index 34ffc176..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b-expected.txt deleted file mode 100644 index 162a152c..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (50,50) size 420x320 - LayoutBlockFlow (positioned) {HTML} at (50,50) size 420x320 [border: (10px solid #000000)] - LayoutBlockFlow {BODY} at (18,18) size 384x0
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b.htm deleted file mode 100644 index 93aff80..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009b.htm +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:absolute; left:50px; top:50px; width:50%; height:50%; border:10px solid black;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-009-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body> -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e-expected.png deleted file mode 100644 index 34ffc176..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e-expected.txt deleted file mode 100644 index 7e50669..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x0 - LayoutBlockFlow {HTML} at (0,0) size 800x0 -layer at (50,50) size 420x320 - LayoutBlockFlow (positioned) {BODY} at (50,50) size 420x320 [border: (10px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e.htm deleted file mode 100644 index 903b4a3c..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009e.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-009-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body style="position:absolute; width:50%; height:50%; top:50px; left:50px; margin:0; border:10px solid black;"> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f-expected.png b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f-expected.png deleted file mode 100644 index 34ffc176..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f-expected.txt b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f-expected.txt deleted file mode 100644 index 3e0eaab..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x300 - LayoutBlockFlow (relative positioned) {HTML} at (0,0) size 800x300 -layer at (50,50) size 420x320 - LayoutBlockFlow (positioned) {BODY} at (50,50) size 420x320 [border: (10px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f.htm deleted file mode 100644 index c42b3e5f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/abspos-containing-block-initial-009f.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html style="position:relative; height:50%;"><head><title>CSS Test: Test for containing block for absolutely positioned elements being initial containing block</title> -<link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"> -<link rel="match" href="abspos-containing-block-initial-009-ref.htm"> -<meta name="assert" content="If there is no such ancestor, the containing block is the initial containing block."> -<meta name="flags" content=""> -</head><body style="position:absolute; width:50%; top:50px; left:50px; height:100%; margin:0; border:10px solid black;"> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-001.htm deleted file mode 100644 index 553b87b5..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-001.htm +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' and margins top and bottom are 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="The margin top and bottom used values are '0' for block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' and margin top and bottom both are 'auto'."> - <style type="text/css"> - #div1 - { - border-bottom: solid orange; - border-top: solid orange; - width: 1in; - } - div div - { - background: blue; - margin-bottom: auto; - margin-top: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no white space between the blue box below and the orange lines.</p> - <div id="div1"> - <div>Filler Text</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-002.htm deleted file mode 100644 index cab181dc..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-002.htm +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="The margin top and bottom used values are '0' for block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible' and margin top and bottom both are 'auto'."> - <style type="text/css"> - #div1 - { - border-bottom: solid orange; - border-top: solid orange; - width: 1in; - } - div div - { - background: blue; - margin-bottom: auto; - margin-top: auto; - } - html, body - { - overflow: scroll; - } - </style> - </head> - <body> - <p>Test passes if there is no white space between the blue box below and the orange lines.</p> - <div id="div1"> - <div>Filler Text</div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-003.htm deleted file mode 100644 index e48875f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-003.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' and 'height' is 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="The 'height' is the 'height' of the child block box when a block-level non-replaced element is in normal flow and 'overflow' computes to 'visible'."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - width: 1in; - } - #div1 div - { - background: blue; - height: 2in; - } - #div2 - { - background: orange; - height: 2in; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <div id="div1"> - <div></div> - </div> - <div id="div2"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-004.htm deleted file mode 100644 index e433cff..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-004.htm +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible' and 'height' is 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="The 'height' is the 'height' of the child block box when a block-level non-replaced element is in normal flow and 'overflow' does not compute to 'visible'."> - <style type="text/css"> - html, body - { - overflow: scroll; - } - div - { - position: relative; - } - div div - { - width: 1in; - } - #div1 div - { - background: blue; - height: 2in; - } - #div2 - { - background: orange; - height: 2in; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <div id="div1"> - <div></div> - </div> - <div id="div2"></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-005.htm deleted file mode 100644 index 3c15f292..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-005.htm +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' and 'height' is 'auto' adjust based on the line box height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The 'height' is the distance from the topmost to the bottommost line box when a block-level non-replaced element is in normal flow and 'overflow' computes to 'visible'."> - <style type="text/css"> - div - { - position: relative; - } - #div1 - { - background: red; - width: 2in; - } - span - { - color: blue; - display: inline; - font: 1in/1em Ahem; - } - #div2 - { - background: orange; - height: 2in; - left: 2in; - position: absolute; - top: 0; - width: 2in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height and there is no red visible on the page.</p> - <div> - <div id="div1"> - <span>XX XX</span> - </div> - <div id="div2"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-006.htm deleted file mode 100644 index e03680aa..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-006.htm +++ /dev/null
@@ -1,50 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible' and 'height' is 'auto' adjust based on the line box height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The 'height' is the distance from the topmost to the bottommost line box when a block-level non-replaced element is in normal flow and 'overflow' does not compute to 'visible'."> - <style type="text/css"> - html, body - { - overflow: scroll; - } - div - { - position: relative; - } - #div1 - { - background: red; - width: 2in; - } - span - { - color: blue; - display: inline; - font: 1in/1em Ahem; - } - #div2 - { - background: orange; - height: 2in; - left: 2in; - position: absolute; - top: 0; - width: 2in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height and there is no red visible on the page.</p> - <div> - <div id="div1"> - <span>XX XX</span> - </div> - <div id="div2"></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-007.htm deleted file mode 100644 index 52db7f5..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-007.htm +++ /dev/null
@@ -1,51 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Height determination for block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' and elements' margins collapse</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="The 'height' is the distance between the top border edge of the top most block-level child box that doesn't have margins collapsed through it, and the bottom border edge of the bottommost block-level child that doesn't have margins collapsed through it. When a block-level non-replaced element is in normal flow, 'overflow' computes to 'visible' and the 'height' is 'auto'."> - <style type="text/css"> - #div1 - { - position: relative; - } - #div2, #div3, #div4 - { - width: 1in; - } - #div2, #div3 - { - background: blue; - height: 0.5in; - } - #div2 - { - border-top: 0.5in solid blue; - margin-top: 0.5in; - } - #div3 - { - border-bottom: 0.5in solid blue; - margin-bottom: 0.5in; - } - #div4 - { - background: blue; - height: 2in; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if there is a blue square below.</p> - <div id="div1"> - <div id="div2"></div> - <div id="div3"></div> - <div id="div4"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-008.htm deleted file mode 100644 index 57cb034..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-008.htm +++ /dev/null
@@ -1,55 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Height determination for block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible' and elements' margins collapse</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="The 'height' is the distance between the top border edge of the top most block-level child box that doesn't have margins collapsed, and the bottom border edge of the bottommost block-level child that doesn't have margins collapsed. When a block-level non-replaced element is in normal flow, 'overflow' does not compute to 'visible' but has been propagated to the viewport and the 'height' is 'auto'."> - <style type="text/css"> - html, body - { - overflow: scroll; - } - #div1 - { - position: relative; - } - #div2, #div3, #div4 - { - width: 1in; - } - #div2, #div3 - { - background: blue; - height: 0.5in; - } - #div2 - { - border-top: 0.5in solid blue; - margin-top: 0.5in; - } - #div3 - { - border-bottom: 0.5in solid blue; - margin-bottom: 0.5in; - } - #div4 - { - background: blue; - height: 2in; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if there is a blue square below.</p> - <div id="div1"> - <div id="div2"></div> - <div id="div3"></div> - <div id="div4"></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-009.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-009.htm deleted file mode 100644 index f8222ea..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-009.htm +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Height determination for block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' and elements' margins do not collapse</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="When a block-level non-replaced element is in normal flow, 'overflow' computes to 'visible', the 'height' is 'auto' and top and bottom margins do not collapse. The 'height' is the sized from the top of the topmost margin edge of the content to the bottom of the bottom most margin edge of the content."> - <style type="text/css"> - #div1 - { - position: relative; - } - #div2 - { - background: blue; - border-bottom: 0.25in solid blue; - border-top: 0.25in solid blue; - } - #div2, #div3, #div4, #div5 - { - width: 1in; - } - #div3, #div4 - { - background: blue; - height: 0.25in; - } - #div3 - { - border-top: 0.25in solid blue; - margin-top: 0.25in; - } - #div4 - { - border-bottom: 0.25in solid blue; - margin-bottom: 0.25in; - } - #div5 - { - background: blue; - height: 2in; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if there is a blue square below.</p> - <div id="div1"> - <div id="div2"> - <div id="div3"></div> - <div id="div4"></div> - </div> - <div id="div5"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-010.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-010.htm deleted file mode 100644 index 75f3c2a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-010.htm +++ /dev/null
@@ -1,63 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Height determination for block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible' and elements' margins do not collapse</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="When a block-level non-replaced element is in normal flow, 'overflow' does not compute to 'visible', the 'height' is 'auto' and top and bottom margins do not collapse. The 'height' is the sized from the top of the topmost margin edge of the content to the bottom of the bottom most margin edge of the content."> - <style type="text/css"> - html, body - { - overflow: scroll; - } - #div1 - { - position: relative; - } - #div2 - { - background: blue; - border-bottom: 0.25in solid blue; - border-top: 0.25in solid blue; - } - #div2, #div3, #div4, #div5 - { - width: 1in; - } - #div3, #div4 - { - background: blue; - height: 0.25in; - } - #div3 - { - border-top: 0.25in solid blue; - margin-top: 0.25in; - } - #div4 - { - border-bottom: 0.25in solid blue; - margin-bottom: 0.25in; - } - #div5 - { - background: blue; - height: 2in; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if there is a blue square below.</p> - <div id="div1"> - <div id="div2"> - <div id="div3"></div> - <div id="div4"></div> - </div> - <div id="div5"></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-011.htm deleted file mode 100644 index aac22cde..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-011.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated children are ignored for 'height' on block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="A floated child element is not considered when sizing the 'height' of a block-level non-replaced element is in normal flow."> - <style type="text/css"> - #div1 - { - background: red; - } - div div - { - float: left; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-012.htm deleted file mode 100644 index 2d9ce7f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-012.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated children are ignored for 'height' on block-level non-replaced elements in normal flow when 'overflow' does not computes to 'visible'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="A floated child element is not considered when sizing the 'height' of a block-level non-replaced element is in normal flow."> - <style type="text/css"> - html, body - { - overflow: scroll; - } - #div1 - { - background: red; - } - div div - { - float: left; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-013.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-013.htm deleted file mode 100644 index 2eada89b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-013.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: An absolutely positioned child elements' 'height' is ignored for block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned child element is not considered when sizing the 'height' of a block-level non-replaced element is in normal flow."> - <style type="text/css"> - #div1 - { - background: red; - } - div div - { - height: 1in; - position: absolute; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-014.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-014.htm deleted file mode 100644 index 3bd9d68b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-014.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: An absolutely positioned child elements' 'height' is ignored for block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="An absolutely positioned child element is not considered when sizing the 'height' of a block-level non-replaced element is in normal flow."> - <style type="text/css"> - html, body - { - overflow: scroll; - } - #div1 - { - background: red; - } - div div - { - height: 1in; - position: absolute; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-015.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-015.htm deleted file mode 100644 index 5d845a8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-015.htm +++ /dev/null
@@ -1,49 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: A relative positioned child elements' offset is ignored for 'height' on a block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="A relative positioned child elements' offset is not considered when sizing the 'height' of a block-level non-replaced element is in normal flow."> - <style type="text/css"> - #div1 - { - position: relative; - } - #div2 - { - background: blue; - } - #div2 div - { - position: relative; - top: 1in; - } - #div3 - { - background: orange; - left: 1in; - position: absolute; - top: 0; - } - #div2 div, #div3 - { - height: 1in; - } - div div - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <div id="div2"> - <div></div> - </div> - <div id="div3"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-016.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-016.htm deleted file mode 100644 index c944655..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-height-016.htm +++ /dev/null
@@ -1,53 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: A relative positioned child elements' offset is ignored for 'height' on a block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <meta name="flags" content=""> - <meta name="assert" content="A relative positioned child elements' offset is not considered when sizing the 'height' of a block-level non-replaced element is in normal flow."> - <style type="text/css"> - html, body - { - overflow: scroll; - } - #div1 - { - position: relative; - } - #div2 - { - background: blue; - } - #div2 div - { - position: relative; - top: 1in; - } - #div3 - { - background: orange; - left: 1in; - position: absolute; - top: 0; - } - #div2 div, #div3 - { - height: 1in; - } - div div - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <div id="div2"> - <div></div> - </div> - <div id="div3"></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-001.htm deleted file mode 100644 index ee41f89..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-001.htm +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving for width of block-level non-replaced elements in normal flow</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta name="flags" content=""> - <meta name="assert" content="The equation; 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' is equal the width of containing block."> - <style type="text/css"> - #div1 - { - background-color: orange; - border: 5px solid orange; - display: inline-block; - } - div div - { - background-color: orange; - border-left: 10px solid orange; - border-right: 10px solid orange; - height: 20px; - margin-left: 10px; - margin-right: 10px; - padding-left: 10px; - padding-right: 10px; - width: 80px; - } - #d3 - { - background-color: blue; - height: 30px; - position: absolute; - top: 82px; - width: 150px; - } - </style> - </head> - <body> - <p>Test passes if the orange and blue boxes below are the same width.</p> - <div id="div1"> - <div></div> - </div> - <div id="d3"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-002.htm deleted file mode 100644 index 5e922f97..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-002.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving for width of block-level non-replaced elements in normal flow when 'width' is 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta name="flags" content=""> - <meta name="assert" content="When width is auto and the combination of border widths, padding widths, scrollbar widths, width, and non 'auto' margin widths are larger than the width of the containing block, the margin widths are treated as 0."> - <style type="text/css"> - #div1 - { - margin-top: 15px; - width: 100px; - } - div div - { - background-color: orange; - border-left: 10px solid orange; - border-right: 10px solid orange; - height: 30px; - margin-left: auto; - padding-left: 10px; - padding-right: 10px; - width: 110px; - } - #div2 - { - background-color: blue; - height: 30px; - position: absolute; - top: 82px; - width: 150px; - } - </style> - </head> - <body> - <p>Test passes if the orange and blue boxes below are the same width.</p> - <div id="div1"> - <div></div> - </div> - <div id="div2"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-003.htm deleted file mode 100644 index 3a29971..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-003.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving over-constrained situation for block-level non-replaced elements in normal flow and direction is left-to-right</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta name="flags" content=""> - <meta name="assert" content="When direction is left-to-right, margin-right is ignored in an over-constrained situation."> - <style type="text/css"> - div - { - direction: ltr; - } - #div1 - { - background: orange; - width: 100px; - } - div div - { - background-color: orange; - border-left: 10px solid orange; - border-right: 10px solid orange; - height: 30px; - margin-left: 10px; - margin-right: 10px; - padding-left: 10px; - padding-right: 10px; - width: 100px; - } - #div2 - { - background-color: blue; - height: 30px; - position: absolute; - top: 82px; - width: 150px; - } - </style> - </head> - <body> - <p>Test passes if the orange and blue boxes below are the same width.</p> - <div id="div1"> - <div></div> - </div> - <div id="div2"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-004.htm deleted file mode 100644 index 01a69f4..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-004.htm +++ /dev/null
@@ -1,50 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving over-constrained situation for block-level non-replaced elements in normal flow and direction is right-to-left</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta name="flags" content=""> - <meta name="assert" content="When direction is right-to-left, margin-left is ignored in an over-constrained situation."> - <style type="text/css"> - div - { - direction: rtl; - position: relative; - } - #div1 - { - background: orange; - width: 100px; - } - #div1 div - { - background-color: orange; - border-left: 10px solid orange; - border-right: 10px solid orange; - height: 30px; - margin-left: 10px; - margin-right: 10px; - padding-left: 10px; - padding-right: 10px; - width: 100px; - } - #div2 - { - background-color: blue; - height: 30px; - position: absolute; - width: 150px; - } - </style> - </head> - <body> - <p>Test passes if the orange and blue boxes below are the same width.</p> - <div> - <div id="div1"> - <div></div> - </div> - <div id="div2"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-005.htm deleted file mode 100644 index 286536eb..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-005.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving width for block-level non-replaced elements in normal flow with single 'auto' value</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta name="flags" content=""> - <meta name="assert" content="If 'width' is set to 'auto', no other 'auto' values are set the 'width' is computed based the width of the containing block."> - <style type="text/css"> - body - { - margin: 0; - } - #div1 - { - background: red; - width: 100%; - } - div div - { - background-color: green; - border: none; - margin: 0; - padding: 0; - height: 40px; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the box below spans the entire width of the page and there is no red visible on the page.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-006.htm deleted file mode 100644 index 8d17d544..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-006.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Solving width for block-level non-replaced elements in normal flow with multiple properties with 'auto' values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta name="flags" content=""> - <meta name="assert" content="If 'width' is set to 'auto', any other 'auto' values become '0' and the 'width' is computed based on remaining space which includes any negative width."> - <style type="text/css"> - body - { - margin: 0; - } - #div1 - { - background: red; - width: 100%; - } - div div - { - background-color: green; - border: 10px solid green; - margin: 0 auto; - padding: 0; - height: 20px; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the box below spans the entire width of the page and there is no red visible on the page.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-007.htm deleted file mode 100644 index 3f5af62..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-007.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Box centering with 'margin-left' and 'margin-right' set to auto</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'margin-left' and 'margin-right' are set to auto and the element has a 'width' then the box will be centered."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - #div2 - { - background-color: orange; - border-color: orange; - border-style: solid; - border-width: 0 0.25in; - margin: 0 auto; - padding: 0; - height: 1in; - width: 0.5in; - } - #div3 - { - color: blue; - font: 1in/1em Ahem; - text-align: center; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes are the same width and the blue box is directly below the orange box.</p> - <div id="div1"> - <div id="div2"></div> - <div id="div3">X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-008.htm deleted file mode 100644 index a8ef3c2..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-non-replaced-width-008.htm +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Solving 'width: auto' of a block-level non-replaced element in normal flow with one other property set to an 'auto' value</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="help" title="10.3.3 Block-level, non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth"> - <meta content="" name="flags"> - <meta content="If 'width' is set to 'auto', any other 'auto' values become '0' and the determination of 'width' proceeds from the following equality: 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block" name="assert"> - - <style type="text/css"> - div {height: 200px;} - - div#containing-block - { - border-right: red solid 200px; - padding-right: 200px; - width: 0px; - } - - div#child - { - border-right: green solid 200px; - margin-right: -400px; - } - - /* - Calculation of used width for div#child: - - margin-left : 0px (or auto) - + border-left-width : 0px - + padding-left : 0px - + width : auto - + padding-right : 0px - + border-right-width : 200px - + margin-right : -400px - ==================================== - width of containing block : 0px - - Therefore 'width: auto' must be resolved as 'width: 200px'. - Therefore div#child's green border-right should overlap perfectly - div#containing-block's red border-right. - */ - </style> - - </head> - - <body> - - <p>Test passes if there is a filled green square below and <strong>no red</strong>.</p> - - <div id="containing-block"> - <div id="child"></div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-001.htm deleted file mode 100644 index 02833eaf..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-001.htm +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements with 'margin-top' and 'margin-bottom' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="A block replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'."> - <style type="text/css"> - div - { - border-bottom: solid orange; - border-top: solid orange; - line-height: 0; - width: 1in; - } - img - { - display: block; - margin-top: auto; - margin-bottom: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no white space between the blue box below and the orange lines.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-002.htm deleted file mode 100644 index 2d8160a7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-002.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements relying on intrinsic height dimensions</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an block replaced element with and intrinsic height has a 'height' and 'width' computed as 'auto'."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 15px; - left: 15px; - position: absolute; - top: 0; - width: 15px; - } - img - { - display: block; - height: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-003.htm deleted file mode 100644 index 8010724..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-003.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements with intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an block replaced element has an intrinsic ratio, 'height' is set to 'auto' and 'width' is specified."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 1in; - left: 1in; - position: absolute; - top: 0; - } - img - { - display: inline; - height: auto; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-004.htm deleted file mode 100644 index 3f2f868..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-004.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements without intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For block replaced elements the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: block; - height: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-005.htm deleted file mode 100644 index 2269379..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-005.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements with percentage based intrinsic height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="A block replaced elements with a percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: block; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-007.htm deleted file mode 100644 index 417cf41..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-height-007.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements with percentage based intrinsic height that cannot be resolved</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="A block replaced elements with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: block; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-width-001.htm deleted file mode 100644 index f6c219c..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-width-001.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements and 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> - <script src="../../resources/ahem.js"></script> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-replaced-width"> - <meta name="flags" content="ahem image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on block replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - display: block; - margin-left: auto; - margin-right: auto; - } - div div - { - color: orange; - font: 15px/1em Ahem; - text-align: center; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and they are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div>X</div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-width-006.htm deleted file mode 100644 index 178f728..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/block-replaced-width-006.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block replaced elements and 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> - <script src="../../resources/ahem.js"></script> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-replaced-width"> - <meta name="flags" content="ahem image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - height: 3in; - width: 2in; - } - img - { - display: block; - margin-left: auto; - margin-right: auto; - } - div div - { - color: orange; - font: 1in/1em Ahem; - text-align: center; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and they are horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div>X</div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-001.htm deleted file mode 100644 index 66b44e9..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-001.htm +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inheriting 'top' changes from relpos grandparent</title> - <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> - <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"> - <meta name="flags" content="dom"> - <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its relatively positioned grandparent changes when the grandparent's 'top' value is changed."> - <style type="text/css"> - .testDiv { position: absolute; width: 100px; height: 100px; } - #green { top: 4em; background: green; } - #red { top: inherit; background: red; } - #parent { top: inherit; position: relative; } - #grandparent { position: relative; } - </style> - <script type="text/javascript"> - window.onload = function() { - document.body.offsetWidth; - document.getElementById("grandparent").style.top = "2em"; - } - </script> - </head> - <body> - <p>There should be no red.</p> - <div id="grandparent"> - <div id="parent"> - <div id="red" class="testDiv"></div> - </div> - <div id="green" class="testDiv"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-002.htm deleted file mode 100644 index 355afdc3..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-002.htm +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inheriting 'top' changes from parent table-row through anonymous table boxes</title> - <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> - <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"> - <meta name="flags" content="dom"> - <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its parent changes when the parent's 'top' value is changed even if the parent is display:table-row."> - <style type="text/css"> - .testDiv { width: 100px; height: 100px; } - #green { top: 4em; background: green; position: absolute; } - #red { top: inherit; background: red; position: relative; } - #parent { position: absolute; top: 2em; } - #intermediate { display: table-row; } - </style> - <script type="text/javascript"> - window.onload = function() { - document.body.offsetWidth; - document.getElementById("intermediate").style.top = "2em"; - } - </script> - </head> - <body> - <p>There should be no red.</p> - <div id="parent"> - <div id="intermediate"> - <div id="red" class="testDiv"></div> - </div> - </div> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-003.htm deleted file mode 100644 index 873c20f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-003.htm +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inheriting 'top' changes from parent table through anonymous table boxes</title> - <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> - <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"> - <meta name="flags" content="dom"> - <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its parent changes when the parent's 'top' value is changed even if the parent is display:table."> - <style type="text/css"> - .testDiv { width: 100px; height: 100px; } - #green { top: 4em; background: green; position: absolute; } - #red { top: inherit; background: red; position: relative; } - #parent { position: absolute; top: 2em; } - #intermediate { display: table; } - </style> - <script type="text/javascript"> - window.onload = function() { - document.body.offsetWidth; - document.getElementById("intermediate").style.top = "2em"; - } - </script> - </head> - <body> - <p>There should be no red.</p> - <div id="parent"> - <div id="intermediate"> - <div id="red" class="testDiv"></div> - </div> - </div> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-004.htm deleted file mode 100644 index 69f2125..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-004.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inheriting 'top' changes from abspos parent</title> - <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> - <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"> - <meta name="flags" content="dom"> - <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its parent changes when the parent's 'top' value is changed."> - <style type="text/css"> - .testDiv { width: 100px; height: 100px; } - #green { top: 4em; background: green; position: absolute; } - #red { top: inherit; background: red; position: relative; } - #parent { position: absolute; } - </style> - <script type="text/javascript"> - window.onload = function() { - document.body.offsetWidth; - document.getElementById("parent").style.top = "2em"; - } - </script> - </head> - <body> - <p>There should be no red.</p> - <div id="parent"> - <div id="red" class="testDiv"></div> - </div> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005-expected.html deleted file mode 100644 index 8363b94..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test Reference Result: Inheriting 'top' changes from abspos grandparent</title> - <style type="text/css"> - .testDiv { position: relative; width: 100px; height: 100px; } - #green { top: 100px; background: green; } - body > p { position: absolute; font-size: medium; } - body { font-size: 0; line-height: 0; position: relative; } - </style> - </head> - <body> - <p>There should be no red.</p> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005.htm deleted file mode 100644 index cdf6df7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inheriting 'top' changes from abspos grandparent</title> - <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> - <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"> - <meta name="flags" content="dom combo"> - <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its relatively positioned parent changes when the parent's 'top' value is changed."> - <style type="text/css"> - .testDiv { position: relative; width: 100px; height: 100px; } - #green { top: 100px; background: green; } - #red { top: inherit; background: red; display: block; } - #parent { position: relative; } - body > p { position: absolute; font-size: medium; } - #grandparent { position: absolute; top: 0; } - body { font-size: 0; line-height: 0; position: relative; } - </style> - <script type="text/javascript"> - window.onload = function() { - document.body.offsetWidth; - document.getElementById("parent").style.top = "50px"; - } - </script> - </head> - <body> - <p>There should be no red.</p> - <div id="grandparent"> - <span id="parent"> - <span id="red" class="testDiv"></span> - </span> - </div> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005a-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005a-expected.html deleted file mode 100644 index 263fa2a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005a-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test Reference Result</title> - <style type="text/css"> - .testDiv { position: relative; width: 100px; height: 100px; } - #green { top: 100px; background: green; } - body > p { position: absolute; font-size: medium; } - body { font-size: 0; line-height: 0; position: relative; } - </style> - </head> - <body> - <p>There should be no red.</p> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005a.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005a.htm deleted file mode 100644 index ecfa42f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005a.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inheriting 'top' changes from abspos grandparent (variant: block parent)</title> - <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> - <link rel="author" title="L. David Baron" href="http://dbaron.org/"> - <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"> - <meta name="flags" content="dom"> - <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its relatively positioned parent changes when the parent's 'top' value is changed."> - <style type="text/css"> - .testDiv { position: relative; width: 100px; height: 100px; } - #green { top: 100px; background: green; } - #red { top: inherit; background: red; display: block; } - #parent { position: relative; } - body > p { position: absolute; font-size: medium; } - #grandparent { position: absolute; top: 0; } - body { font-size: 0; line-height: 0; position: relative; } - </style> - <script type="text/javascript"> - window.onload = function() { - document.body.offsetWidth; - document.getElementById("parent").style.top = "50px"; - } - </script> - </head> - <body> - <p>There should be no red.</p> - <div id="grandparent"> - <div id="parent"> - <span id="red" class="testDiv"></span> - </div> - </div> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005b-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005b-expected.html deleted file mode 100644 index e0028e05..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005b-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test Reference Result: Inheriting 'top' changes from abspos grandparent (non-dynamic variant)</title> - <style type="text/css"> - .testDiv { position: relative; width: 100px; height: 100px; } - #green { top: 100px; background: green; } - body > p { position: absolute; font-size: medium; } - body { font-size: 0; line-height: 0; position: relative; } - </style> - </head> - <body> - <p>There should be no red.</p> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005b.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005b.htm deleted file mode 100644 index 0a65426..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/dynamic-top-change-005b.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inheriting 'top' changes from abspos grandparent (non-dynamic variant)</title> - <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> - <link rel="author" title="L. David Baron" href="http://dbaron.org/"> - <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"> - <meta name="flags" content="dom"> - <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its relatively positioned parent changes when the parent's 'top' value is changed."> - <style type="text/css"> - .testDiv { position: relative; width: 100px; height: 100px; } - #green { top: 100px; background: green; } - #red { top: inherit; background: red; display: block; } - #parent { position: relative; top: 50px; } - body > p { position: absolute; font-size: medium; } - #grandparent { position: absolute; top: 0; } - body { font-size: 0; line-height: 0; position: relative; } - </style> - </head> - <body> - <p>There should be no red.</p> - <div id="grandparent"> - <span id="parent"> - <span id="red" class="testDiv"></span> - </span> - </div> - <div id="green" class="testDiv"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-001.htm deleted file mode 100644 index c4c6d962..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-001.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Empty inline elements</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#inline-formatting"> - <meta name="flags" content=""> - <meta name="assert" content="Empty inline elements create a zero-height line box."> - <style type="text/css"> - div - { - background: red; - } - span - { - display: inline; - } - </style> - </head> - <body> - <p>Test passes if there is no red on this page.</p> - <div> - <span></span> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-002.htm deleted file mode 100644 index a43a465..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-002.htm +++ /dev/null
@@ -1,66 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Empty line box influence</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="Empty inline elements still influence calculation just like elements with content."> - <style type="text/css"> - div, span - { - font: 1in/1em Ahem; - } - #div1 - { - margin-top: 1in; - } - #div2, #div3 - { - width: 5in; - } - #div2 - { - border: 0.25in solid green; - } - span - { - background: green; - border: 0.25in solid green; - margin: 1in; - padding: 1in; - } - #div3 - { - border: 0.25in solid red; - height: 1in; - position: relative; - top: -1.5in; - z-index: -1; - } - #div3 div - { - background: red; - border: 0.25in solid red; - height: 3in; - margin: 0 1in; - position: relative; - top: -1.25in; - width: 2in; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <div id="div2"> - <span></span> - </div> - <div id="div3"> - <div></div> - </div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-003.htm deleted file mode 100644 index 60a71ed9..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/empty-inline-003.htm +++ /dev/null
@@ -1,52 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Line height calculations: the 'line-height' and 'vertical-align' properties - Empty inline elements influence</title> - - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#line-height"> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - <meta content="The line-height of an empty inline element influences the height of a line containing it with some other content" name="assert"> - <meta content="" name="flags"> - - <style type="text/css"> - #test - { - background-color: lime; - line-height: 1; - } - - #empty-inline-element - { - line-height: 5; - } - - #reference-overlapped-red - { - background-color: red; - left: 0; - line-height: 5; - position: absolute; - top: 0; - width: 100%; - z-index: -1; - } - - #relatively-positioned-wrapper - { - position: relative; - } - </style> - - </head> - - <body> - <p>Test passes if there is a wide bright green rectangle below with one "X" in it and if there is no red.</p> - - <div id="relatively-positioned-wrapper"> - <div id="test"><span id="empty-inline-element"></span>X</div> - <div id="reference-overlapped-red">X</div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-height-001.htm deleted file mode 100644 index 4d68744..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-height-001.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated non-replaced element with 'margin-top', margin-bottom' set to 'auto' and 'height' relying on the descendants</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-root-margin"> - <meta name="flags" content=""> - <meta name="assert" content="If 'height' is 'auto' on an floated non-replaced element then the 'height' depends on the descendants."> - <style type="text/css"> - #div1 - { - position: relative; - } - #div2 - { - background: blue; - float: left; - } - #div2 div, #div3 - { - height: 1in; - width: 1in; - } - #div3 - { - background: orange; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <div id="div2"> - <div></div> - </div> - <div id="div3"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-001.htm deleted file mode 100644 index 18cb3ddd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-001.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floating non-replaced elements with 'auto' left margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <meta name="flags" content=""> - <meta name="assert" content="If 'margin-left' is computed as 'auto' its used value is '0'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - div div - { - background-color: blue; - float: left; - margin-left: auto; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-002.htm deleted file mode 100644 index 5eb27c9e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-002.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floating non-replaced elements with specified left margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <meta name="flags" content=""> - <meta name="assert" content="If 'margin-left' is not computed as 'auto' its used value is as specified."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - div div - { - background-color: blue; - float: left; - margin-left: 0.5in; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is horizontally centered inside the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-003.htm deleted file mode 100644 index 696a2f09..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-003.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floating non-replaced elements with 'auto' right margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <meta name="flags" content=""> - <meta name="assert" content="If 'margin-right' is computed as 'auto' its used value is '0'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - div div - { - background-color: blue; - float: right; - margin-right: auto; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-004.htm deleted file mode 100644 index 8afe373..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-004.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floating non-replaced elements with specified right margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <meta name="flags" content=""> - <meta name="assert" content="If 'margin-right' is not computed as 'auto' its used value is as specified."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - div div - { - background-color: blue; - float: right; - margin-right: 0.5in; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is horizontally centered inside the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-005.htm deleted file mode 100644 index d362488..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-005.htm +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floating non-replaced elements with left and right margins as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <meta name="flags" content=""> - <meta name="assert" content="If both 'margin-left' and margin-right' are computed as 'auto' their used value is as '0'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - div div - { - background-color: blue; - float: left; - margin-left: auto; - margin-right: auto; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-006.htm deleted file mode 100644 index 88a701e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-006.htm +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floating non-replaced elements with 'auto' width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="If 'width' computes to 'auto' then the used value of 'width' is 'shrink-to-fit'."> - <style type="text/css"> - div - { - background: red; - color: green; - float: left; - font: 1in/1em Ahem; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div>X</div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-007.htm deleted file mode 100644 index 9adac06..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-007.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - inline-block and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of a floating, non-replaced element computes to 'auto' or 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: red; - float: left; - font: 32px/4 Ahem; - width: auto; - } - - span - { - background-color: green; - display: inline-block; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div><span>XXXXXXXX</span></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-008.htm deleted file mode 100644 index 3502b48..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-008.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of a floating, non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: red; - float: left; - font: 32px/4 Ahem; - width: auto; - } - - span - { - background-color: green; - float: left; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div><span>XXXXXXXX</span></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-009.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-009.htm deleted file mode 100644 index 166abf6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-009.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of a floating, non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of a floating, non-replaced element is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: red; - float: left; - font: 32px/4 Ahem; - width: auto; - } - - div > div - { - background-color: green; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div> - <div>XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-010.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-010.htm deleted file mode 100644 index 10861cf..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-010.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of a floating, non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' is specified with absolute length, then the computed value is the specified value. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses specified absolute length, then such specified absolute length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: red; - float: left; - font: 32px/4 Ahem; - width: auto; - } - - div > div - { - background-color: green; - width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div> - <div>XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-011.htm deleted file mode 100644 index 9a181a7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-011.htm +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - inline-block and max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of a floating, non-replaced element computes to 'auto' or 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of a floating, non-replaced element computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: red; - float: left; - font: 32px/4 Ahem; - width: auto; - } - - div > div - { - background-color: green; - display: inline-block; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div> - <div>XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-012.htm deleted file mode 100644 index 17f2fa48..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-non-replaced-width-012.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of floating, non-replaced elements - max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.5 Width of floating, non-replaced elements" href="http://www.w3.org/TR/CSS21/visudet.html#float-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of a floating non-replaced element computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation and such calculated width can be furthermore constrained, reduced by a max-width declaration." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: green; - float: left; - font: 32px/4 Ahem; - max-width: 4em; - width: auto; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right.</p> - - <div>XXXXXXXX</div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-001.htm deleted file mode 100644 index f8d3cf5b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-001.htm +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with 'margin-top' and 'margin-bottom' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="A floated replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'."> - <style type="text/css"> - div - { - border-bottom: solid orange; - border-top: solid orange; - line-height: 0; - width: 1in; - } - img - { - margin-top: auto; - margin-bottom: auto; - } - div, img - { - float: left; - } - </style> - </head> - <body> - <p>Test passes if there is no white space between the blue box below and the orange lines.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-002.htm deleted file mode 100644 index c2f59208..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-002.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements relying on intrinsic height dimensions</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an floated replaced element with and intrinsic height has a 'height' and 'width' computed as 'auto'."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 15px; - left: 15px; - position: absolute; - top: 0; - width: 15px; - } - img - { - height: auto; - width: auto; - } - div, img - { - float: left; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-003.htm deleted file mode 100644 index d5c6b87..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-003.htm +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floating replaced elements with intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an floated replaced element has an intrinsic ratio, 'height' is set to 'auto' and 'width' is specified."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 1in; - left: 1in; - position: absolute; - top: 0; - } - img - { - height: auto; - } - div, img - { - float: left; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-004.htm deleted file mode 100644 index 26fe796..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-004.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements without intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For floated replaced elements the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - float: left; - height: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-005.htm deleted file mode 100644 index 50d3f62..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-005.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with percentage based intrinsic height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="A floated replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - float: left; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-007.htm deleted file mode 100644 index 1063c5a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-height-007.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with percentage based intrinsic height that cannot be resolved</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="A floated replaced elements with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - float: left; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-001.htm deleted file mode 100644 index e79e68b0..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-001.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with 'auto' left margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="If 'margin-left' is computed as 'auto' its used value is '0'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - background-color: blue; - float: left; - margin-left: auto; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-002.htm deleted file mode 100644 index 7702d76..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-002.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with specified left margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="If 'margin-left' is not computed as 'auto' its used value is as specified."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - background-color: blue; - float: left; - margin-left: 0.5in; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-003.htm deleted file mode 100644 index 5daa3093..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-003.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with 'auto' right margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="If 'margin-right' is computed as 'auto' its used value is '0'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - background-color: blue; - float: right; - margin-right: auto; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-right corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-004.htm deleted file mode 100644 index d5906b7..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-004.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with specified right margin</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="If 'margin-right' is not computed as 'auto' its used value is as specified."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - background-color: blue; - float: right; - margin-right: 0.5in; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is horizontally centered inside the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-005.htm deleted file mode 100644 index 3c37e39..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-005.htm +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements with left and right margins as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="If both 'margin-left' and margin-right' are computed as 'auto' their used value is as '0'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - background-color: blue; - float: left; - margin-left: auto; - margin-right: auto; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-006.htm deleted file mode 100644 index d2db9ce..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-006.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements and 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on floated replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - float: left; - margin-left: auto; - margin-right: auto; - } - div div - { - background: orange; - height: 15px; - margin-top: 15px; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-011.htm deleted file mode 100644 index 90ddb01..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/float-replaced-width-011.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Floated replaced elements and 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#float-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - height: 3in; - width: 2in; - } - img - { - float: left; - margin-left: auto; - margin-right: auto; - } - div div - { - background: orange; - height: 1in; - margin-top: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floating-replaced-height-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floating-replaced-height-008.htm deleted file mode 100644 index 646ea4e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floating-replaced-height-008.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Floating replaced elements - specified width, height in percentages and intrinsic ratio</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" title="10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements"> - <link rel="bookmark" href="https://bugs.kde.org/show_bug.cgi?id=274790" title="Bug 274790: object specified with width and height percentages and with intrinsic ratio"> - <meta http-equiv="Content-Style-Type" content="text/css"> - <meta content="image" name="flags"> - <meta content="When 'height: 1%' (or any other percentage) applies to a floating replaced element and when the height of its containing block is not specified explicitly (i.e., it depends on content height), then such height computes to 'auto'. Then, if such floating replaced element has an intrinsic ratio and its used width is known or resolved, then the used value of 'height' is determined by the equation (used width) / (intrinsic ratio)." name="assert"> - - <style type="text/css"> - img {float: left;} - </style> - - </head> - - <body> - - <p>There should be <strong>5 filled green squares</strong> with the same width and the <strong>same height</strong>. The 5 filled green squares should be <strong>identical</strong> to each other. This should still remain true even after a window resize.</p> - - <div> - <img src="support/60x60-green.png" width="15%" alt="FAIL: image download must be enabled"><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" width="15%" height="1%" alt="FAIL: image download must be enabled"><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" style="width: 15%;" alt="FAIL: image download must be enabled"><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" style="width: 15%; height: auto;" alt="FAIL: image download must be enabled"><img src="support/swatch-white.png" width="5" height="5" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" style="width: 15%; height: 1%;" alt="FAIL: image download must be enabled"> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-001-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-001-expected.html deleted file mode 100644 index d321302..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-001-expected.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head><meta charset="utf-8"/> - - <title>CSS Reftest Reference</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - - <style type="text/css"> - div - { - border: black solid 5px; - height: 1in; - width: 2in; - } - - img {vertical-align: top;} - </style> - - </head> - - <body> - - <p>Test passes if the blue square is on the left inner edge of the hollow black rectangle.</p> - - <div><img src="support/swatch-blue.png" width="96" height="96" alt="Image download support must be enabled"></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-001.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-001.html deleted file mode 100644 index 27c3d2cd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-001.html +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head><meta charset="utf-8"/> - <title>CSS Test: Floats, shifting left until it touches container edge</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-07-02 --> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> - <link rel="match" href="reference/floats-001-ref.htm"> - - <meta name="flags" content=""> - <meta name="assert" content="A left floated box shifts left until its outer edge touches the containing block edge."> - <style type="text/css"> - #div1 - { - border: solid 5px black; - height: 1in; - width: 2in; - } - div div - { - display: inline-block; - height: 1in; - width: 1in; - } - #div3 - { - background-color: blue; - float: left; - } - </style> - </head> - <body> - <p>Test passes if the blue square is on the left inner edge of the hollow black rectangle.</p> - <div id="div1"> - <div id="div2"></div> - <div id="div3"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-102-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-102-expected.html deleted file mode 100644 index b2f1445..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-102-expected.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <style type="text/css"> - div { border: 1px solid teal; padding: 4px; margin: 4px; } - .left { float: left; } - .right { float: right; } - .size { width: 150px; height: 150px; } - </style> - </head> - <body> - - <p>The content before should be to the right of the inner square, - and both it and the inner square should be surrounded by an outer box.</p> - - <div class="left"><div class="size left"></div>content before</div> - - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-102.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-102.html deleted file mode 100644 index 66475c3c..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-102.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: CSS Floats: Nested floats (some inline content before nested float)</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/002-demo.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> - <style type="text/css"> - div { border: 1px solid teal; padding: 4px; margin: 4px; } - .left { float: left; } - .right { float: right; } - .size { width: 150px; height: 150px; } - </style> - </head> - <body> - - <p>The content before should be to the right of the inner square, - and both it and the inner square should be surrounded by an outer box.</p> - - <div class="left">content before <div class="size left"></div></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-149-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-149-expected.html deleted file mode 100644 index e1e31a6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-149-expected.html +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head><meta charset="utf-8"/> - - <title>CSS Reftest Reference</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - - <style type="text/css"> - table - { - border-spacing: 0px; - table-layout: fixed; - width: 100%; - } - - td - { - padding: 0px; - vertical-align: top; - width: 50%; - } - - div {background-color: green;} - </style> - - </head> - - <body> - - <table> - <tr> - <td>There should be a green bar to the right: ⇨</td> - <td><div> </div></td> - </tr> - </table> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-149.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-149.htm deleted file mode 100644 index c0dc8ccb..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-149.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <head> - <title>CSS Test: Empty inlines being displaced by floats</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-07-01 --> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/049.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> - <link rel="match" href="reference/floats-149-ref.htm"> - - <style type="text/css"> - .block { display: block; background: green; } - .inline { display: inline; margin-left: 40px; } - span { float: left; width: 50%; background: white; } - </style> - </head> - <body> - <div class="block"> - <div class="inline"> - <span>There should be a green bar to the right: ⇨</span> - <span></span> <!-- this float should be on the second "line" --> - </div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html deleted file mode 100644 index aee29e5d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; text-align: left; } -div { float: left; clear: left; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="width: 50px; height: 50px;"></div> -<div style="width: 100px; height: 100px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l.htm deleted file mode 100644 index 59f4425..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-001l-ref.htm"> -<link rel="mismatch" href="floats-wrap-top-below-001l-notref.htm"> -<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -div { float: left; clear: left; } -span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="width: 50px; height: 75px;"></div> -<div style="width: 100px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html deleted file mode 100644 index 9228f460..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; text-align: right; } -div { float: right; clear: right; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> -<div style="width: 50px; height: 50px;"></div> -<div style="width: 100px; height: 100px;"></div><span></span><span></span> -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r.htm deleted file mode 100644 index cd11708..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-001r-ref.htm"> -<link rel="mismatch" href="floats-wrap-top-below-001r-notref.htm"> -<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -div { float: right; clear: right; } -span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; margin-left: auto; } - -</style> -</head> -<body> - -<div style="width: 50px; height: 75px;"></div> -<div style="width: 100px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html deleted file mode 100644 index 794ed98..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 150px; height: 25px;"></div> -<span></span> -<div style="height: 100px"></div> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm deleted file mode 100644 index 0ce9eb84..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-002l-ref.htm"> -<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 150px; height: 75px;"></div> -<div style="float: right; width: 300px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html deleted file mode 100644 index e3f25ef..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 150px; height: 25px;"></div> -<span></span> -<div style="height: 100px"></div> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm deleted file mode 100644 index 5a7171ec..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-002r-ref.htm"> -<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 150px; height: 75px;"></div> -<div style="float: left; width: 300px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html deleted file mode 100644 index 57f58b77..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 250px; height: 25px;"></div> -<span></span> -<span style="margin-top: 25px; margin-right: 250px"></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm deleted file mode 100644 index c1ebe29..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-003l-ref.htm"> -<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: block; overflow: hidden; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 250px; height: 75px;"></div> -<div style="float: right; width: 250px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html deleted file mode 100644 index e6e7887..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 250px; height: 25px;"></div> -<span></span> -<span style="margin-top: 25px; margin-left: 250px"></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm deleted file mode 100644 index e1d575b2..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-003r-ref.htm"> -<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: block; overflow: hidden; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 250px; height: 75px;"></div> -<div style="float: left; width: 250px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html deleted file mode 100644 index aee29e5d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; text-align: left; } -div { float: left; clear: left; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="width: 50px; height: 50px;"></div> -<div style="width: 100px; height: 100px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l.htm deleted file mode 100644 index e0a3127..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-001l-ref.htm"> -<link rel="mismatch" href="floats-wrap-top-below-001l-notref.htm"> -<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; text-align: left; } -div { float: left; clear: left; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="width: 50px; height: 75px;"></div> -<div style="width: 100px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html deleted file mode 100644 index 7f4e886..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; text-align: right; } -div { float: right; clear: right; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="width: 50px; height: 50px;"></div> -<div style="width: 100px; height: 100px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r.htm deleted file mode 100644 index 005bb12..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-001r-ref.htm"> -<link rel="mismatch" href="floats-wrap-top-below-001r-notref.htm"> -<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; text-align: right; } -div { float: right; clear: right; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="width: 50px; height: 75px;"></div> -<div style="width: 100px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html deleted file mode 100644 index 794ed98..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 150px; height: 25px;"></div> -<span></span> -<div style="height: 100px"></div> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l.htm deleted file mode 100644 index c3509393..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-002l-ref.htm"> -<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 150px; height: 75px;"></div> -<div style="float: right; width: 300px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html deleted file mode 100644 index e3f25ef..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 150px; height: 25px;"></div> -<span></span> -<div style="height: 100px"></div> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r.htm deleted file mode 100644 index 6815c58..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-002r-ref.htm"> -<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 150px; height: 75px;"></div> -<div style="float: left; width: 300px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html deleted file mode 100644 index 57f58b77..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 250px; height: 25px;"></div> -<span></span> -<span style="margin-top: 25px; margin-right: 250px"></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l.htm deleted file mode 100644 index 7dc2f5a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-003l-ref.htm"> -<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: left; width: 250px; height: 75px;"></div> -<div style="float: right; width: 250px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html deleted file mode 100644 index e6e7887..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 250px; height: 25px;"></div> -<span></span> -<span style="margin-top: 25px; margin-left: 250px"></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r.htm deleted file mode 100644 index 669cce5..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> -<link rel="match" href="floats-wrap-top-below-003r-ref.htm"> -<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float."> -<meta name="flags" content=""> -<style type="text/css"> - -body { width: 400px; border: medium solid; } -span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } - -</style> -</head> -<body> - -<div style="float: right; width: 250px; height: 75px;"></div> -<div style="float: left; width: 250px; height: 75px;"></div> -<span></span> -<span></span> - - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001-expected.html deleted file mode 100644 index ab28710a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><title>Test for wrapping around zero-height floats</title> - -</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;"> - - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue; margin-left: 10px;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple; margin-left: 100px;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span> - -</div> -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001.htm deleted file mode 100644 index 582665d5..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001.htm +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><title>CSS Test: wrapping around zero-height floats</title> - <link rel="author" title="L. David Baron" href="http://dbaron.org/"> - <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> - <link rel="match" href="floats-zero-height-wrap-001-ref.htm"> - <meta name="flags" content=""> - <meta name="assert" content="wrapping around zero-height floats"> - -</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;"> - - <div style="float: left; width: 10px; height: 30px"></div> - <div style="float: left; clear: left; width: 100px; height: 1px"></div> - - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span> - -</div> -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002-expected.html deleted file mode 100644 index ab28710a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><title>Test for wrapping around zero-height floats</title> - -</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;"> - - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue; margin-left: 10px;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple; margin-left: 100px;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span> - -</div> -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002.htm deleted file mode 100644 index 7568193..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002.htm +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><title>CSS Test: wrapping around zero-height floats</title> - <link rel="author" title="L. David Baron" href="http://dbaron.org/"> - <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats"> - <link rel="match" href="floats-zero-height-wrap-001-ref.htm"> - <meta name="flags" content=""> - <meta name="assert" content="wrapping around zero-height floats"> - -</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;"> - - <div style="float: left; width: 10px; height: 30px"></div> - <div style="float: left; clear: left; width: 100px; height: 0"></div> - - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple;"></span> - <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span> - -</div> -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/height-percentage-005-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/height-percentage-005-expected.html deleted file mode 100644 index 2ed50023..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/height-percentage-005-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <body> - <p>Test passes if there is a filled black square.</p> - - <div id="grandparent"> - <img src="support/black96x96.png" alt="Image download support must be enabled"> - </div> - - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/height-percentage-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/height-percentage-005.htm deleted file mode 100644 index a2674ed..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/height-percentage-005.htm +++ /dev/null
@@ -1,47 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - - <title>CSS Test: height percentage - inline replaced element inside an auto-height container</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - - <!-- - Original post: - Image % sizing interoperability - from Bogdan Brinza who deserves credit for reporting this - http://lists.w3.org/Archives/Public/www-style/2014Jun/0079.html - --> - - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-height-property" title="10.5 Content height: the 'height' property"> - <link rel="bookmark" href="http://lists.w3.org/Archives/Public/www-style/2014Jun/0079.html" title="Image % sizing interoperability"> - <link rel="match" href="reference/ref-filled-black-96px-square.htm"> - - <meta content="image" name="flags"> - <meta content="This test checks that an height percentage is calculated with respect to the height of the generated box's containing block only if and only when such containing block's height is specified explicitly (i.e., it depends on content height; its specified height is not 'auto'). In this test, the div#parent has an 'auto' height; therefore the height percentage specified on div#child is treated as 'auto' and so the image should be rendered (entirely visible) inside that div#child. Note that div#grandparent's initial overflow value is 'visible'." name="assert"> - - <style type="text/css"> - div#grandparent {height: 0px;} - - div#child, img {height: 100%;} - </style> - - </head> - - <body> - - <p>Test passes if there is a filled black square.</p> - - <div id="grandparent"> - <div id="parent"> - <div id="child"> - <img src="support/black96x96.png" alt="Image download support must be enabled"> - </div> - </div> - </div> - - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-height-001.htm deleted file mode 100644 index 521c120..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-height-001.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block non-replaced element with 'margin-top', margin-bottom' set to 'auto' and 'height' relying on the descendants</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-root-margin"> - <meta name="flags" content=""> - <meta name="assert" content="If 'height' is 'auto' on an inline-block non-replaced element then the 'height' depends on the descendants."> - <style type="text/css"> - #div1 - { - position: relative; - } - #div2 - { - background: blue; - display: inline-block; - } - #div2 div, #div3 - { - height: 1in; - width: 1in; - } - #div3 - { - background: orange; - left: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <div id="div2"> - <div></div> - </div> - <div id="div3"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-height-002.htm deleted file mode 100644 index 8181ec04..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-height-002.htm +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block non-replaced elements' margin box is used for the height of the line box</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-root-margin"> - <meta name="flags" content=""> - <meta name="assert" content="Inline-block non-replaced elements use the margin box for sizing the height of the line box."> - <style type="text/css"> - #div1 - { - line-height: 0; - position: relative; - } - #div2 - { - background: blue; - } - #div2 div - { - display: inline-block; - height: 0; - margin: 0.5in 0; - } - div div - { - width: 1in; - } - #div3 - { - background: orange; - left: 1in; - height: 1in; - position: absolute; - top: 0; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <div id="div2"> - <div></div> - </div> - <div id="div3"></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-001.htm deleted file mode 100644 index 36c2726..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-001.htm +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block non-replaced elements shrink-to-fit</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="If 'width' is 'auto' then 'inline-block' elements shrink-to-fit."> - <style type="text/css"> - div - { - background-color: red; - color: blue; - display: inline-block; - font: 1in/1em Ahem; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div>X</div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-002.htm deleted file mode 100644 index e914222..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-002.htm +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block non-replaced elements with 'margin-left' and 'margin-right' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="When 'margin-left' and 'margin-right' are set to 'auto' the used value becomes '0'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - div div - { - background-color: red; - color: blue; - display: inline-block; - font: 1in/1em Ahem; - margin-left: auto; - margin-right: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box is in the upper-left corner of the black box and there is no red visible on the page.</p> - <div id="div1"> - <div>X</div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-003.htm deleted file mode 100644 index 4c94147..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-003.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of inline-block non-replaced elements - max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: red; - display: inline-block; - font: 32px/4 Ahem; - width: auto; - } - - span - { - background-color: green; - display: inline-block; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div><span>XXXXXXXX</span></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-004.htm deleted file mode 100644 index 83f7787..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-non-replaced-width-004.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'shrink-to-fit' width of inline-block non-replaced elements - max-width</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="help" title="Section 10.3.9 Width of 'inline-block', non-replaced elements in normal flow" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <meta content="If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto', then the used value of 'width' is given by 'shrink-to-fit' width calculation. If 'width' of an inline-block, non-replaced element in normal flow is given by 'shrink-to-fit' width calculation, then such calculated width can be furthermore constrained, reduced by a max-width declaration. If 'width' of an inline-block, non-replaced element in normal flow computes to 'auto' but its own child uses a constrained length resulting from a max-width declaration, then such constrained length will define the preferred width in 'shrink-to-fit' width calculation." name="assert"> - <meta content="ahem" name="flags"> - <script src="../../resources/ahem.js"></script> - - <style type="text/css"> - div - { - background-color: red; - display: inline-block; - font: 32px/4 Ahem; - width: auto; - } - - div > div - { - background-color: green; - max-width: 4em; - } - </style> - - </head> - - <body> - - <p>Below there should be a green square. In the middle of such green square, a black horizontal stripe should be traversing it and protruding out of it toward the right. There should be no red in this page.</p> - - <div> - <div>XXXXXXXX</div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-001.htm deleted file mode 100644 index 7c0b78a6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-001.htm +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements with 'margin-top' and 'margin-bottom' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="An inline-block replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'."> - <style type="text/css"> - div - { - border-bottom: solid orange; - border-top: solid orange; - line-height: 0; - width: 1in; - } - img - { - display: inline-block; - margin-top: auto; - margin-bottom: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no white space between the blue box below and the orange lines.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-002.htm deleted file mode 100644 index 85105126..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-002.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements relying on intrinsic height dimensions</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an inline-block replaced element with and intrinsic height has a 'height' and 'width' computed as 'auto'."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 15px; - left: 15px; - position: absolute; - top: 0; - width: 15px; - } - img - { - display: inline-block; - height: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-003.htm deleted file mode 100644 index 0a9ec81..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-003.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements with intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an inline-block replaced element has an intrinsic ratio, 'height' is set to 'auto' and 'width' is specified."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 1in; - left: 1in; - position: absolute; - top: 0; - } - img - { - display: inline; - height: auto; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-004.htm deleted file mode 100644 index 1e36902..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-004.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements without intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For inline-block replaced elements the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: inline-block; - height: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-005.htm deleted file mode 100644 index 8fb909f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-005.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements with percentage based intrinsic height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An inline-block replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: inline-block; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-007.htm deleted file mode 100644 index cad6612..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-007.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements with percentage based intrinsic height that cannot be resolved</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An inline-block replaced elements with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: inline-block; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-008.htm deleted file mode 100644 index 6433a62..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-height-008.htm +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: 'inline-block' replaced elements in normal flow - specified width, height in percentages and intrinsic ratio</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" title="10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements"> - <link rel="bookmark" href="https://bugs.kde.org/show_bug.cgi?id=274790" title="Bug 274790: object specified with width and height percentages and with intrinsic ratio"> - <meta http-equiv="Content-Style-Type" content="text/css"> - <meta content="image" name="flags"> - <meta content="When 'height: 1%' (or any other percentage) applies to an 'inline-block' replaced element and when the height of its containing block is not specified explicitly (i.e., it depends on content height), then such height computes to 'auto'. Then, if such inline-block replaced element has an intrinsic ratio and its used width is known or resolved, then the used value of 'height' is determined by the equation (used width) / (intrinsic ratio)." name="assert"> - - </head> - - <body> - - <p>There should be <strong>5 filled green squares</strong> with the same width and the <strong>same height</strong>. The 5 filled green squares should be <strong>identical</strong> to each other. This should still remain true even after a window resize.</p> - - <div> - <object data="support/60x60-green.png" type="image/png" width="15%">FAIL: image download must be enabled</object> - - <object data="support/60x60-green.png" type="image/png" width="15%" height="1%">FAIL: image download must be enabled</object> - - <object data="support/60x60-green.png" type="image/png" style="width: 15%;">FAIL: image download must be enabled</object> - - <object data="support/60x60-green.png" type="image/png" style="width: 15%; height: auto;">FAIL: image download must be enabled</object> - - <object data="support/60x60-green.png" type="image/png" style="width: 15%; height: 1%;">FAIL: image download must be enabled</object> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-width-001.htm deleted file mode 100644 index e1de07e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-width-001.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements and 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on inline-block replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - div, img - { - line-height: 0; - } - #div1 - { - border: solid black; - height: 2in; - width: 2in; - } - img - { - display: inline-block; - margin-left: auto; - margin-right: auto; - } - div div - { - background: orange; - height: 15px; - width: 15px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-width-006.htm deleted file mode 100644 index 1e057f3..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-block-replaced-width-006.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline-block replaced elements and 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inlineblock-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - height: 3in; - width: 2in; - } - img - { - display: inline-block; - margin-left: auto; - margin-right: auto; - } - div div - { - background: orange; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-box-002-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-box-002-expected.html deleted file mode 100644 index 9a54aae..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-box-002-expected.html +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block boxes within inline boxes are affected by positioning</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> - <meta name="flags" content=""> - <meta name="assert" content="Block boxes within inline boxes are also affected by relative positioning on the inline box."> - <style type="text/css"> - #div1 - { - background: yellow; - height: 2in; - position: relative; - width: 2in; - } - #div2 - { - background: blue; - display: inline; - position: relative; - top: 2in; - } - #div3 - { - position: relative; - top: 2in; - background: orange; - width: 2in; - } - </style> - </head> - <body> - <p>Test passes if the orange box is between the two blue boxes and all three boxes are below the yellow box.</p> - <div id="div1"> - <span id="div2">Filler Text</span> - <div id="div3">Filler Text</div> - <span id="div2">Filler Text</span> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-box-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-box-002.htm deleted file mode 100644 index 7e7b5dd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-box-002.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Block boxes within inline boxes are affected by positioning</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> - <meta name="flags" content=""> - <meta name="assert" content="Block boxes within inline boxes are also affected by relative positioning on the inline box."> - <style type="text/css"> - #div1 - { - background: yellow; - height: 2in; - position: relative; - width: 2in; - } - #div2 - { - background: blue; - display: inline; - position: relative; - top: 2in; - } - #div3 - { - background: orange; - width: 2in; - } - </style> - </head> - <body> - <p>Test passes if the orange box is between the two blue boxes and all three boxes are below the yellow box.</p> - <div id="div1"> - <div id="div2"> - Filler Text - <div id="div3">Filler Text</div> - Filler Text - </div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-height-002.htm deleted file mode 100644 index aee3e57..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-height-002.htm +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline non-replaced elements and padding</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-non-replaced"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The padding starts at the top and bottom of the content area not the 'line-height'."> - <style type="text/css"> - #div1 - { - margin-top: 1in; - position: relative; - } - span - { - background: blue; - color: blue; - font: 1in Ahem; - line-height: 1.5in; - padding: 0.5in 0; - } - div div - { - background: orange; - height: 2in; - left: 1in; - position: absolute; - top: -0.25in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <span>X</span> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-height-003.htm deleted file mode 100644 index 1ece759..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-height-003.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline non-replaced elements and border</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-non-replaced"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="The border starts at the top and bottom of the content area not the 'line-height'."> - <style type="text/css"> - #div1 - { - margin-top: 1in; - position: relative; - } - span - { - background: blue; - border-bottom: 0.5in solid blue; - border-top: 0.5in solid blue; - color: blue; - font: 1in Ahem; - line-height: 1.5in; - } - div div - { - background: orange; - height: 2in; - left: 1in; - position: absolute; - top: -0.25in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div id="div1"> - <span>X</span> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-width-001.htm deleted file mode 100644 index 08f658f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-width-001.htm +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline non-replaced elements with 'auto' value for 'left', 'right', and 'margin-left'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="Computed value of 'auto' for 'left', 'right', and 'margin-left' becomes a used value of '0'."> - <style type="text/css"> - div - { - border: solid black; - height: 2in; - width: 2in; - } - span - { - color: blue; - font: 1in/1em Ahem; - left: auto; - margin-left: auto; - position: relative; - right: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box below is in the upper-left corner of the black box.</p> - <div> - <span>X</span> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-width-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-width-002.htm deleted file mode 100644 index c00abe2e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-non-replaced-width-002.htm +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline non-replaced elements with 'auto' value for 'left', 'right', and 'margin-right'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-width"> - <meta name="flags" content="ahem"> - <script src="../../resources/ahem.js"></script> - <meta name="assert" content="Computed value of 'auto' for 'left', 'right', and 'margin-right' becomes a used value of '0'."> - <style type="text/css"> - div - { - border: solid black; - height: 2in; - width: 2in; - } - span - { - color: blue; - font: 1in/1em Ahem; - left: auto; - margin-right: auto; - position: relative; - right: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue box below is in the upper-left corner of the black box.</p> - <div> - <span>X</span> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-001.htm deleted file mode 100644 index 42751b42..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-001.htm +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements with 'margin-top' and 'margin-bottom' as 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="An inline replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'."> - <style type="text/css"> - div - { - border-bottom: solid orange; - border-top: solid orange; - line-height: 0; - width: 1in; - } - img - { - display: inline; - margin-bottom: auto; - margin-top: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no white space between the blue box below and the orange lines.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-002.htm deleted file mode 100644 index 2a2f8b7d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-002.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements relying on intrinsic height dimensions</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the intrinsic height when an inline replaced element with and intrinsic height has a 'height' and 'width' computed as 'auto'."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 15px; - left: 15px; - position: absolute; - top: 0; - width: 15px; - } - img - { - display: inline; - height: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-003.htm deleted file mode 100644 index 6501e151..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-003.htm +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements with intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="image"> - <meta name="assert" content="The 'height' is the used width divided by the ratio when an inline replaced element has an intrinsic ratio, 'height' is set to 'auto' and 'width' is specified."> - <style type="text/css"> - div - { - line-height: 0; - position: relative; - } - div div - { - background: orange; - height: 1in; - left: 1in; - position: absolute; - top: 0; - } - img - { - display: inline; - height: auto; - } - div div, img - { - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same height.</p> - <div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-004.htm deleted file mode 100644 index 272a0783..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-004.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements without intrinsic ratios and 'height' set to 'auto'</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="For inline replaced elements the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: inline; - height: auto; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div> - <iframe></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-005.htm deleted file mode 100644 index f4299fe8..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-005.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements with percentage based intrinsic height</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An inline replaced element with percentage intrinsic height resolves based on the containing block height when percentage is explicitly specified."> - <style type="text/css"> - #div1 - { - position: relative; - height: 2in; - } - div div - { - border: solid green; - height: 1in; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: inline; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-007.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-007.htm deleted file mode 100644 index 7a38fed..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-007.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements with percentage based intrinsic height that cannot be resolved</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content=""> - <meta name="assert" content="An inline replaced elements with a percentage height that cannot be resolved has no intrinsic height."> - <style type="text/css"> - #div1 - { - position: relative; - } - div div - { - border: solid green; - height: 150px; - position: absolute; - top: 0; - width: 300px; - } - iframe - { - border: solid red; - display: inline; - width: auto; - } - </style> - </head> - <body> - <p>Test passes if there is no red visible on the page.</p> - <div id="div1"> - <iframe height="50%"></iframe> - <div></div> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-008.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-008.htm deleted file mode 100644 index 62b90e3..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-height-008.htm +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Inline replaced elements in normal flow - specified width, height in percentages and intrinsic ratio</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height" title="10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements"> - <meta http-equiv="Content-Style-Type" content="text/css"> - <meta content="image" name="flags"> - <meta content="When 'height: 1%' (or any other percentage) applies to an inline replaced element and when the height of its containing block is not specified explicitly (i.e., it depends on content height), then such height computes to 'auto'. Then, if such inline replaced element has an intrinsic ratio and its used width is known or resolved, then the used value of 'height' is determined by the equation (used width) / (intrinsic ratio)." name="assert"> - - </head> - - <body> - - <p>There should be <strong>5 filled green squares</strong> with the same width and the <strong>same height</strong>. The 5 filled green squares should be <strong>identical</strong> to each other. This should still remain true even after a window resize.</p> - - <div> - <img src="support/60x60-green.png" width="15%" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" width="15%" height="1%" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" style="width: 15%;" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" style="width: 15%; height: auto;" alt="FAIL: image download must be enabled"> - - <img src="support/60x60-green.png" style="width: 15%; height: 1%;" alt="FAIL: image download must be enabled"> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-001.htm deleted file mode 100644 index a78e4489..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-001.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements and 'auto' specified for 'margin-left', 'margin-right' and intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on inline replaced elements becomes a used value of '0'. The intrinsic width is also used if 'height' and 'width' are 'auto'."> - <style type="text/css"> - #div1 - { - border: solid black; - height: 3in; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - } - div div - { - background: orange; - height: 96px; - width: 96px; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 96x96" src="resources/blue96x96.png"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-006.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-006.htm deleted file mode 100644 index 8bdd48a1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-006.htm +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Inline replaced elements and 'auto' specified for 'margin-left', 'margin-right' and percentage intrinsic width</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <meta name="flags" content="image"> - <meta name="assert" content="Percentage intrinsic widths are evaluated against the containing block's width."> - <style type="text/css"> - div - { - line-height: 0; - } - #div1 - { - border: solid black; - height: 3in; - width: 2in; - } - img - { - margin-left: auto; - margin-right: auto; - } - div div - { - background: orange; - height: 1in; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> - <div id="div1"> - <img alt="blue 15x15" src="resources/blue15x15.png" width="50%"> - <div></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-011.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-011.htm deleted file mode 100644 index eacbcad..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-011.htm +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <title>CSS Test: Replaced inline elements with % widths</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/001.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <style type="text/css"> - div { width: 600px: height: 100px; background: red; } - img { width: 100%; height: 100px; vertical-align: bottom; } - </style> - </head> - <body> - <p>There should be no red below.</p> - <div> - <p><img src="resources/swatch-green.png" alt="Image support required for this test"></p> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-012.htm deleted file mode 100644 index 11ce3cc..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-012.htm +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <title>CSS Test: Replaced inline elements wrapping around floats (% widths)</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/002.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <style type="text/css"> - div { width: 600px; height: 200px; background: red; } - div p { height: 100px; background: green; } - img { vertical-align: bottom; } - img.float { float: left; } - img.flow { width: 100%; height: 100px; } - </style> - </head> - <body> - <p>There should be no red below.</p> - <div> - <p> - <img src="resources/swatch-green.png" height="100" alt="" class="float"> - <img src="resources/swatch-green.png" alt="Image support required for this test" class="flow"> - </p> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-013.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-013.htm deleted file mode 100644 index add9c45b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-013.htm +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <title>CSS Test: Replaced inline elements wrapping around floats (pixel widths)</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/003.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <style type="text/css"> - div { width: 600px; height: 200px; background: red; } - div p { height: 100px; background: green; } - img { vertical-align: bottom; } - img.float { float: left; } - img.flow { width: 600px; height: 100px; } - </style> - </head> - <body> - <p>There should be no red below.</p> - <div> - <p> - <img src="resources/swatch-green.png" height="100" alt="" class="float"> - <img src="resources/swatch-green.png" alt="Image support required for this test" class="flow"> - </p> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-014.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-014.htm deleted file mode 100644 index 80a4f6b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-014.htm +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <title>CSS Test: Replaced inline elements with % widths</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/004.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <style type="text/css"> - div.a { width: 300px; height: 100px; background: red; } - div.a p { width: 200%; } - div.a img { width: 50%; height: 100px; vertical-align: bottom; } - div.b { width: 300px; position: relative; } - div.b p { width: 200%; } - div.b img { width: 50%; height: 100px; vertical-align: bottom; } - div.b span { position: absolute; top: 0; left: 0; background: green; width: 300px; height: 100px; } - </style> - </head> - <body> - <p>There should be no red below, just two 300×100 pixel green - rectangles seperated by 1em of margin.</p> - <div class="a"> - <p> - <img src="resources/1x1-green.png" alt="Image support required for this test"> - </p> - </div> - <div class="b"> - <p> - <img src="resources/1x1-red.png" alt="Image support required for this test"> - <span></span> - </p> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-015.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-015.htm deleted file mode 100644 index e16380af..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-replaced-width-015.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <title>CSS Test: Replaced inline elements wrapping around floats (% widths)</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/005.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <style type="text/css"> - div.test { width: 300px; height: 200px; background: red; position: relative; } - div.inner { width: 300px; height: 100px; background: lime; } - div p { width: 125%; height: 100px; } /* 375px */ - img { vertical-align: bottom; } - img.float { float: left; height: 100px; width: 100px; } - img.flow { width: 80%; height: 100px; } /* 300px */ - span { position: absolute; bottom: 0; left: 0; background: lime; height: 100px; width: 300px; } - </style> - </head> - <body> - <p>There should be no red below, just two 300x200 pixel lime rectangles.</p> - <div class="test a"> - <div class="inner"> - <p> - <img src="resources/1x1-lime.png" alt="" class="float"> - <img src="resources/1x1-lime.png" alt="Image support required for this test" class="flow"> - </p> - </div> - </div> - <div class="test b"> - <div class="inner"> - <p> - <img src="resources/1x1-lime.png" alt="" class="float"> - <img src="resources/1x1-red.png" alt="Image support required for this test" class="flow"> - <span></span> - </p> - </div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-table-002a.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-table-002a.htm deleted file mode 100644 index 6887979..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-table-002a.htm +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for inline-table</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#table-display"> -<meta name="assert" content="it is a rectangular block that participates in an inline formatting context)."> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading"> -<link rel="match" href="inline-table-002-ref.htm"> -<meta name="assert" content="The baseline of an 'inline-table' is the baseline of the first row of the table."> -<meta name="flags" content=""> -<style type="text/css"> -span { display: inline-table; } -span > span { display: block; visibility: hidden; } -</style> -</head> -<body> -<p>a<span>bcd<span>x</span></span>e</p> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-table-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/inline-table-003.htm deleted file mode 100644 index 8e78aeb2..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/inline-table-003.htm +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head> -<title>CSS Test: Test for inline-table</title> -<link rel="author" title="L. David Baron" href="http://dbaron.org/"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#table-display"> -<meta name="assert" content="it is a rectangular block that participates in an inline formatting context)."> -<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading"> -<link rel="match" href="inline-table-003-ref.htm"> -<meta name="assert" content="The baseline of an 'inline-table' is the baseline of the first row of the table."> -<meta name="flags" content=""> -<style type="text/css"> -span { display: inline-table; } -</style> -</head> -<body> -<p>a<span>b</span>c</p> - - -</body></html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-027-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-027-expected.html deleted file mode 100644 index 6a2006a..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-027-expected.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Reftest Reference</title> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - - <style type="text/css"> - div - { - background-color: green; - height: 1.25em; - margin: 1em 0em 5em; - width: 6.25em; - } - </style> - - </head> - - <body> - - <p>Test passes if there is no red.</p> - - <div></div> - - <div></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-027.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-027.htm deleted file mode 100644 index 913096e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-027.htm +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Margin collapsing - bottom margin not collapse when cleared</title> - <script src="../../resources/ahem.js"></script> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> - <link rel="match" href="clearance-006-ref.htm"> - - <meta name="flags" content="ahem image"> - <meta name="assert" content="When a last sibling has clearance, its own margins collapse and it collapsed its margins with a subsequent sibling, the last sibling does not collapse its bottom margin with its parent's bottom margin."> - <style type="text/css"> - div - { - font: 20px/1em Ahem; - width: 5em; - } - #div1 - { - background: url('support/margin-collapse-4em-space.png'); - height: 6em; - } - #div2 - { - margin-bottom: 2em; - } - #div3, #div5 - { - margin-bottom: 1em; - } - #div3, #div6 - { - background: green; - height: 1em; - } - #div4 - { - float: left; - height: 1em; - } - #div5 - { - clear: both; - margin-top: 1.5em; - } - </style> - </head> - <body> - <p>Test passes if there is no red.</p> - <div id="div1"> - <div id="div2"> - <div id="div3"></div> - <div id="div4"></div> - <div id="div5"></div> - </div> - <div id="div6"></div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-012-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-012-expected.html deleted file mode 100644 index 1bf1d88..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-012-expected.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Reftest Reference</title> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - - <style type="text/css"> - div#lime - { - background-color: lime; - border-top: black solid 1px; - height: 200px; - width: 50%; - } - - div#yellow - { - background-color: yellow; - height: 100px; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="lime"><img src="support/swatch-blue.png" height="100" width="100" alt="Image download support must be enabled"></div> - - <div id="yellow"></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-012.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-012.htm deleted file mode 100644 index 4689a5e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-012.htm +++ /dev/null
@@ -1,127 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Margin collapsing with clearance - margins of a 'collapsed through' box with clearance do not collapse with parent block's bottom margin</title> - - <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - <link rel="match" href="margin-collapse-clear-012-ref.htm"> - - <meta content="When an element has had clearance applied to it and its own margins collapse, these margins collapse with the adjoining margins of following siblings but the resulting margin does not collapse with the bottom margin of the parent block" name="assert"> - <meta content="" name="flags"> - - <style type="text/css"> - #rel-pos-wrapper {position: relative;} - - #parent-lime - { - background-color: lime; - border-top: black solid 1px; - width: 50%; - } - - #float-left-blue - { - background-color: blue; - float: left; - height: 100px; - width: 100px; - } - - #clear-left - { - clear: left; - margin-bottom: 80px; - margin-top: 40px; - } - - #following-sibling {margin-bottom: 140px;} - - #next-yellow - { - background-color: yellow; - height: 100px; - } - - .ref-overlapped-red - { - background-color: red; - position: absolute; - z-index: -1; - } - - #ref1 - { - height: 200px; - top: 1px; - width: 50%; - } - - #ref2 - { - height: 100px; - top: 201px; - width: 100%; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="rel-pos-wrapper"> - - <!-- - - #parent-lime should have height 200px, sum of: - - 100px : height of #float-left-blue - + - (140px - 40px) : part of #following-sibling's margin-bottom - "exceeding" the amount collapsed with - #clear-left's margin-top (140px - 40px) - ======= - 200px - - --> - - <div id="parent-lime"> - <div id="float-left-blue"></div> - <div id="clear-left"></div> - - <!-- - - clearance - + - margin-top of #clear-left (40px) - ==================================== - height of #float-left-blue (100px) - - therefore, clearance is equal to +60px - - --> - - <div id="following-sibling"></div> - </div> - - <div id="next-yellow"></div> - - <!-- - #ref1 and #ref2 boxes create a sort of 'reference rendering' - where #ref1 should be covered, overlapped by #parent-lime - while #ref2 should be covered, overlapped by #next-yellow. - --> - - <div id="ref1" class="ref-overlapped-red"></div> - <div id="ref2" class="ref-overlapped-red"></div> - - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-013-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-013-expected.html deleted file mode 100644 index 1bf1d88..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-013-expected.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Reftest Reference</title> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - - <style type="text/css"> - div#lime - { - background-color: lime; - border-top: black solid 1px; - height: 200px; - width: 50%; - } - - div#yellow - { - background-color: yellow; - height: 100px; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="lime"><img src="support/swatch-blue.png" height="100" width="100" alt="Image download support must be enabled"></div> - - <div id="yellow"></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-013.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-013.htm deleted file mode 100644 index 14befd6..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-013.htm +++ /dev/null
@@ -1,127 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Margin collapsing with clearance - margins of a 'collapsed through' box with clearance do not collapse with parent block's bottom margin</title> - - <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - <link rel="match" href="margin-collapse-clear-012-ref.htm"> - - <meta content="When an element has had clearance applied to it and its own margins collapse, these margins do not collapse with the bottom margin of the parent block" name="assert"> - <meta content="" name="flags"> - - <style type="text/css"> - #rel-pos-wrapper {position: relative;} - - #parent-lime - { - background-color: lime; - border-top: black solid 1px; - width: 50%; - } - - #float-left-blue - { - background-color: blue; - float: left; - height: 100px; - width: 100px; - } - - #clear-left - { - clear: left; - margin-bottom: 140px; - margin-top: 40px; - } - - #next-yellow - { - background-color: yellow; - height: 100px; - } - - .ref-overlapped-red - { - background-color: red; - position: absolute; - z-index: -1; - } - - #ref1 - { - height: 200px; - top: 1px; - width: 50%; - } - - #ref2 - { - height: 100px; - top: 201px; - width: 100%; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="rel-pos-wrapper"> - - <!-- - - clearance - + - margin-top of #clear-left (40px) - ==================================== - height of #float-left-blue (100px) - - therefore, clearance is equal to +60px - - --> - - <!-- - - #parent-lime should have height 200px, sum of: - - 100px : height of #float-left-blue - + - (140px - 40px) : part of #sole-following-sibling's margin-bottom - "exceeding" the amount collapsed with - #clear-left's margin-top (140px - 40px) - ======= - 200px - - --> - - <div id="parent-lime"> - <div id="float-left-blue"></div> - <div id="clear-left"></div> - </div> - - <!-- - #next-yellow should immediately follow #parent-lime (no margins in between) - --> - - <div id="next-yellow"></div> - - <!-- - #ref1 and #ref2 boxes create a sort of 'reference rendering' - where #ref1 should be covered, overlapped by #parent-lime - while #ref2 should be covered, overlapped by #next-yellow. - --> - - <div id="ref1" class="ref-overlapped-red"></div> - <div id="ref2" class="ref-overlapped-red"></div> - - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-014-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-014-expected.html deleted file mode 100644 index 997a67bd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-014-expected.html +++ /dev/null
@@ -1,47 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Reftest Reference</title> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - - <style type="text/css"> - div#aqua - { - background-color: aqua; - height: 60px; - width: 50%; - } - - div#lime - { - background-color: lime; - line-height: 140px; - width: 50%; - } - - img {vertical-align: bottom;} - - div#yellow - { - background-color: yellow; - height: 100px; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="aqua"></div> - - <div id="lime"><img src="support/swatch-blue.png" height="100" width="100" alt="Image download support must be enabled"></div> - - <div id="yellow"></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-014.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-014.htm deleted file mode 100644 index 5c008ea1..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-014.htm +++ /dev/null
@@ -1,129 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Margin collapsing with clearance - clearance may be negative</title> - - <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#normal-block"> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - <link rel="match" href="margin-collapse-clear-014-ref.htm"> - - <meta content="Clearance is created above the top margin of the element with clear set. Clearance can be negative. Clearance stops the collapsing of the element's margins with the preceding siblings' margins and with the parent block's bottom margin." name="assert"> - <meta content="" name="flags"> - - <style type="text/css"> - #rel-pos-wrapper {position: relative;} - - #parent-lime - { - background-color: lime; - width: 50%; - } - - #preceding-sibling-aqua - { - background-color: aqua; - height: 60px; - margin-bottom: 40px; - } - - #float-left-blue - { - background-color: blue; - float: left; - height: 100px; - width: 100px; - } - - #clear-left - { - clear: left; - margin-top: 120px; - } - - #next-yellow - { - background-color: yellow; - height: 100px; - } - - .ref-overlapped-red - { - background-color: red; - position: absolute; - z-index: -1; - } - - #ref1 - { - height: 200px; - top: 0px; - width: 50%; - } - - #ref2 - { - height: 100px; - top: 200px; - width: 100%; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="rel-pos-wrapper"> - - <!-- - - #parent-lime should have height 200px, sum of: - - 60px : height of #preceding-sibling-aqua - + - 40px : margin-bottom of #preceding-sibling-aqua - + - 100px : height of #float-left-blue - ===================================================== - 200px - - --> - - <div id="parent-lime"> - <div id="preceding-sibling-aqua"></div> - <div id="float-left-blue"></div> - <div id="clear-left"></div> - </div> - - <!-- - - clearance - + - margin-top of #clear-left (120px) - ==================================== - height of #float-left-blue (100px) - - therefore, clearance is equal to -20px - - --> - - <div id="next-yellow"></div> - - <!-- - #ref1 and #ref2 boxes create a sort of 'reference rendering' - where #ref1 should be covered, overlapped by #parent-lime - while #ref2 should be covered, overlapped by #next-yellow. - --> - - <div id="ref1" class="ref-overlapped-red"></div> - <div id="ref2" class="ref-overlapped-red"></div> - - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-015-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-015-expected.html deleted file mode 100644 index 6310a64..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-015-expected.html +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Reftest Reference</title> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - - <style type="text/css"> - div#lime - { - background-color: lime; - border-top: black solid 1px; - height: 140px; - width: 50%; - } - - div#aqua - { - background-color: aqua; - height: 60px; - width: 50%; - } - - div#yellow - { - background-color: yellow; - height: 100px; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="lime"><img src="support/swatch-blue.png" height="100" width="100" alt="Image download support must be enabled"></div> - - <div id="aqua"></div> - - <div id="yellow"></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-015.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-015.htm deleted file mode 100644 index c11831f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-015.htm +++ /dev/null
@@ -1,101 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Margin collapsing with clearance - Margins collapsing of an element's top margin with its first in-flow child should not be affected by clear and clearance</title> - - <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com"> - <link rel="match" href="margin-collapse-clear-015-ref.htm"> - - <meta content="When an element with clear set to it (to other than 'none') has a first in-flow child and their top margins are adjoining, then these margins should collapse normally." name="assert"> - <meta content="" name="flags"> - - <style type="text/css"> - #rel-pos-wrapper {position: relative;} - - #parent-lime - { - background-color: lime; - border-top: black solid 1px; - width: 50%; - } - - #float-left-blue - { - background-color: blue; - float: left; - height: 100px; - width: 100px; - } - - #clear-left {clear: left;} - - #clear-left > div - { - background-color: aqua; - height: 60px; - margin-top: 140px; - } - - #next-yellow - { - background-color: yellow; - height: 100px; - } - - .ref-overlapped-red - { - background-color: red; - left: 0; - position: absolute; - z-index: -1; - } - - #ref1 - { - height: 200px; - top: 1px; - width: 50%; - } - - #ref2 - { - height: 100px; - top: 201px; - width: 100%; - } - </style> - - </head> - - <body> - - <p>Test passes if there is <strong>no red</strong>.</p> - - <div id="rel-pos-wrapper"> - - <div id="parent-lime"> - <div id="float-left-blue"></div> - <div id="clear-left"> - <div></div> - </div> - </div> - - <div id="next-yellow"></div> - - <!-- - #ref1 and #ref2 boxes create a sort of 'reference rendering' - where #ref1 should be covered, overlapped by #parent-lime - while #ref2 should be covered, overlapped by #next-yellow. - --> - - <div id="ref1" class="ref-overlapped-red"></div> - <div id="ref2" class="ref-overlapped-red"></div> - - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-016-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-016-expected.html deleted file mode 100644 index 304861e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-016-expected.html +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Reftest Reference</title> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - - <style type="text/css"> - div - { - background-color: green; - height: 100px; - } - </style> - - </head> - - <body> - - <p>Test passes if there is a wide filled green rectangle and <strong>no red</strong>.</p> - - <div></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-016.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-016.htm deleted file mode 100644 index c525bd55..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-016.htm +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Margin collapsing - margins of a 'collapsed through' box without clearance can collapse with parent block's bottom margin</title> - - <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="match" href="margin-collapse-clear-016-ref.htm"> - - <meta content="An element that does not have clearance applied to it can collapse its top margin with its parent block's bottom margin. Margins of a 'collapsed through' box without clearance applied to it can collapse with its parent block's bottom margin. An element with clear set to it (to other than 'none') can only create a clearance if and when there is a preceding floated block." name="assert"> - <meta content="" name="flags"> - - <style type="text/css"> - body - { - background-color: white; - } - - #parent-block - { - background-color: red; - margin-bottom: 0px; - } - - #sibling - { - background-color: green; - height: 100px; - } - - #element-without-clearance-applied - { - clear: both; - margin-top: 100px; - } - </style> - - </head> - - <body> - - <p>Test passes if there is a wide filled green rectangle and <strong>no red</strong>.</p> - - <div id="parent-block"> - <div id="sibling"></div> - <div id="element-without-clearance-applied"></div> - </div> - - <!-- - #element-without-clearance-applied's margin-top collapses - with #parent-block's margin-bottom: the resulting margin-bottom - then collapses with the adjoining white body's margin-bottom - --> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-017-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-017-expected.html deleted file mode 100644 index ef4420e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-017-expected.html +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Reftest Reference</title> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - - <style type="text/css"> - body - { - background: white url("support/ruler-v-100px-200px-300px.png") no-repeat; - margin: 34px 8px 8px 55px; - } - - p - { - font-size: 16px; - line-height: 20px; - margin: 1em 8px; - } - - div - { - background-color: green; - height: 10px; - margin-bottom: 100px; - } - </style> - - </head> - - <body> - - <p>Test passes if there is a vertical gap<br> - of exactly 100px between 2 green bars.</p> - - <div></div> - - <div></div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-017.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-017.htm deleted file mode 100644 index 76beb887..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/margin-collapse-clear-017.htm +++ /dev/null
@@ -1,81 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: Margin collapsing - margins of a 'collapsed through' box without clearance can collapse with parent block's bottom margin</title> - - <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de"> - <link rel="match" href="margin-collapse-clear-017-ref.htm"> - - <meta content="An element that does not have clearance applied to it can collapse its top margin with its parent block's bottom margin. Margins of a 'collapsed through' box without clearance applied to it can collapse with its parent block's bottom margin. An element with 'clear' set to a value other than 'none' can create a clearance only if and only when there is an earlier (in the source document) floating box." name="assert"> - <meta content="image" name="flags"> - - <style type="text/css"> - body - { - background: white url("support/ruler-v-100px-200px-300px.png") no-repeat; - margin: 34px 8px 8px 55px; - /* - 34px : body's top margin collapsing with p's top margin: max(34px, 16px) - + 20px : p's 1st line box height - + 20px : p's 2nd line box height - + 16px : p's bottom margin - + 10px : height of topmost green bar - ====== - 100px - */ - } - - p - { - font-size: 16px; - line-height: 20px; - margin: 1em 8px; - } - - div#parent-block {margin-bottom: 100px;} - - div.vertical-gap-separator - { - background-color: green; - height: 10px; - } - - div#element-without-clearance - { - clear: both; - margin-top: 100px; - } - - /* - In this test, div#element-without-clearance - is what the spec refers to as - 'collapsed through' box - http://www.w3.org/TR/CSS21/box.html#collapsed-through - */ - </style> - - </head> - - <body> - - <p>Test passes if there is a vertical gap<br> - of exactly 100px between 2 green bars.</p> - - <div id="parent-block"> - <div class="vertical-gap-separator"></div> - <div id="element-without-clearance"></div> - </div> - - <div class="vertical-gap-separator"></div> - - <!-- - div#element-without-clearance's margin-top should collapse - with #parent-block's margin-bottom: max(100px, 100px) = 100px - --> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/max-height-percentage-003-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/max-height-percentage-003-expected.html deleted file mode 100644 index 9a3ee6d..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/max-height-percentage-003-expected.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> - <p>Test passes if there is a filled black square.</p> - - <div id="parent"> - <img src="support/black96x96.png" alt="Image download support must be enabled"> - </div>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/max-height-percentage-003.html b/third_party/WebKit/LayoutTests/css2.1/20110323/max-height-percentage-003.html deleted file mode 100644 index 9a4d4cc..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/max-height-percentage-003.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - - <title>CSS Test: max-height percentage - inline replaced element inside an auto-height container</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - - <!-- - Original post: - Image % sizing interoperability - from Bogdan Brinza who deserves credit for reporting this - http://lists.w3.org/Archives/Public/www-style/2014Jun/0079.html - --> - - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-heights" title="10.7 Minimum and maximum heights: 'min-height' and 'max-height'"> - <link rel="bookmark" href="http://lists.w3.org/Archives/Public/www-style/2014Jun/0079.html" title="Image % sizing interoperability"> - <link rel="match" href="reference/ref-filled-black-96px-square.htm"> - - <meta content="image" name="flags"> - <meta content="This test checks that a max-height percentage is calculated with respect to the height of the generated box's containing block only if and only when such containing block's height is specified explicitly (i.e., it depends on content height; its specified height is not 'auto'). In this test, the div#child has an 'auto' height; therefore the max-height percentage is treated as 'none' and so the image should be rendered (entirely visible) inside that div#child. Note that div#parent's initial overflow value is 'visible'." name="assert"> - - <style type="text/css"> - div#parent {height: 0px;} - - img {max-height: 100%;} - </style> - - </head> - - <body> - - <p>Test passes if there is a filled black square.</p> - - <div id="parent"> - <div id="child"><img src="support/black96x96.png" alt="Image download support must be enabled"></div> - </div> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-elements-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-elements-001.htm deleted file mode 100644 index 89270cd..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-elements-001.htm +++ /dev/null
@@ -1,47 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - - <head> - - <title>CSS Test: replaced elements - margin</title> - - <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-replaced-width"> - <meta name="flags" content=""> - <meta name="assert" content="Block-level, replaced elements with margin-left: auto and margin-right: auto should be centered within their respective parent block"> - - <style type="text/css"> - div - { - background-color: green; - margin: 1em; - } - - input - { - background-color: orange; - display: block; - margin-left: auto; - margin-right: auto; - width: auto; - } - </style> - - </head> - - <body> - - <p>Below, there should be 2 orange boxes horizontally centered within their respective green bars.</p> - - <div> - <input type="button" value=""> - </div> - - <form action=""> - <div> - <input type="submit" value=""> - </div> - </form> - - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-001.htm deleted file mode 100644 index 317ef2b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-001.htm +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <title>CSS Test: Replaced inline elements (using <object>) and SVG intrinsic widths</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/intrinsic/svg/001.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <meta name="flags" content="svg"> - <style type="text/css"> - html { width: 150px; padding: 0; margin: 8px; } - body { padding: 0; margin: 0; } - p { padding: 0; margin: 0; } - object { width: auto; height: auto; } /* intrinsic size is 100%x100%, which is equivalent to width:100% height:auto (since height:auto on parent) */ - .control { background: red; width: 150px; height: 150px; border: solid lime 2px; margin: -2px; position: absolute; z-index: -1; } - </style> - </head> - <body> - <p>There should be a green square below this line, exactly fitting inside a 2px lime border.</p> - <p class="control">FAIL (absolute positioning not supported) </p> - <p><object data="resources/replaced-intrinsic-001.svg" type="image/svg+xml"> FAIL (SVG not supported) </object></p> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-002.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-002.htm deleted file mode 100644 index 195d8611..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-002.htm +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <title>CSS Test: Replaced inline elements (using <object>) and SVG intrinsic widths (negative test equivalent of 001)</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/intrinsic/svg/002.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <meta name="flags" content="svg"> - <style type="text/css"> - html { width: 150px; padding: 0; margin: 8px; position: relative; } - body { padding: 0; margin: 0; } - p { font: 16px/20px serif; padding: 0; margin: 0; } - object { width: auto; height: auto; } /* intrinsic size is 100%x100%, which is equivalent to width:100% height:auto (since height:auto on parent) */ - div { position: absolute; top: 20px; left: 0; height: 150px; width: 150px; background: green; } - </style> - </head> - <body> - <p>There should be an exact square of green below this line: <object data="resources/replaced-intrinsic-002.svg" type="image/svg+xml"> FAIL (SVG not supported) </object> </p> - <div></div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-003.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-003.htm deleted file mode 100644 index 7a6a53e..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-003.htm +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html lang="en"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <title>CSS Test: Replaced block elements (using <object>) and SVG intrinsic widths</title> - <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/intrinsic/svg/003.html" type="text/html"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <meta name="flags" content="image svg"> - <style type="text/css"> - html { background: white; color: navy; } - body { background: 100px 0 url(resources/test-tr.png) no-repeat; } - div { width: 100px; background: url(resources/test-bl.png) bottom left no-repeat; } - div p { background: url(resources/test-tl.png) top left no-repeat; } - object { display: block; margin: auto; padding-right: 100px; background: url(resources/test-br.png) bottom right no-repeat; } - </style> - </head> - <body> - <div><p><object data="resources/replaced-intrinsic-003.svg" type="image/svg+xml"> FAIL (SVG not supported) </object></p></div> - <p>There should be a complete unbroken yin-yang symbol (☯) above.</p> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-004.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-004.htm deleted file mode 100644 index e17fc189..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-004.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Auto Intrinsic Sizes: Intrinsic Height Only and Specified Width</title> - <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <meta name="flags" content="svg"> - <meta name="assert" content="A replaced element with an intrinsic height only and a specified width is drawn at the specified width and intrinsic height."> - <style type="text/css"> - object { - border: solid 20px red; - background: green; - width: 60px; - } - .control { - position: absolute; - border: solid 20px green; - height: 60px; - width: 60px; - } - </style> - </head> - <body> - <p>There must be a green box below and no red.</p> - - <div class="control"></div> - <div class="container"> - <object data="resources/replaced-intrinsic-004.svg" type="image/svg+xml">FAIL: SVG support required</object> - </div> - - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-005.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-005.htm deleted file mode 100644 index e99cdc53..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-005.htm +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Auto Intrinsic Sizes: Intrinsic Width Only and Auto Height</title> - <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <meta name="flags" content="svg"> - <meta name="assert" content="A replaced element with an intrinsic height only and a specified width is drawn at the specified width and intrinsic height."> - <style type="text/css"> - object { - border: solid 20px red; - background: green; - } - .control { - position: absolute; - border: solid 20px green; - height: 150px; - width: 60px; - } - </style> - </head> - <body> - <p>There must be a green box below and no red.</p> - - <div class="control"></div> - <div><object data="resources/replaced-intrinsic-005.svg" type="image/svg+xml">FAIL: SVG support required</object></div> - - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-ratio-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-ratio-001.htm deleted file mode 100644 index 84ba9cf..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-intrinsic-ratio-001.htm +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Auto Width for Replaced Element with Intrinsic Ratio Only</title> - <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> - <link rel="help" href="http://www.w3.org/TR/SVGTiny12/coords.html#IntrinsicSizing"> - <meta name="flags" content="may svg"> - <style type="text/css"> - body { width: 15em; border: 1px silver dashed; overflow: hidden} - table, td { border-spacing: 0; border-collapse: collapse; padding: 0; } - p, table { margin: 6em 0; height: 1em; line-height: 1em;} - - /* basic tests for inline and block */ - #img1 { margin-top: -1em; } - #img2 { display: block; } - - /* shrinkwrapped */ - #p3 { width: 100%; float: left; margin: 0; } - #t4 { width: 15em; display: table-cell; } - #t5 { width: 100%; } - - /* controls */ - object { background: red; } - object, .control { border: 1em blue solid; margin: 0 1em; } - - .control { background: green; } - .inst { height: auto; margin: 1em 0; } - </style> - </head> - <body> - <p class="inst">The following six blue boxes must be of the same width. There must be no red.</p> - <p class="control"> </p> - <p> - <!-- sizing is against containing block, not available space --> - <object id="img1" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p> - <p><object id="img2" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p> - <p id="t4"><object id="img4" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p> - <table id="t5"><tr><td><object id="img5" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></td></tr></table> - <p id="p3"><object id="img3" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-min-max-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-min-max-001.htm deleted file mode 100644 index bd780ab..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/replaced-min-max-001.htm +++ /dev/null
@@ -1,314 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements</title> - <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="reviewer" title="Ian Hickson" href="mailto:ian@hixie.ch"> - <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/replaced/intrinsic/001.html" type="text/html"> - <meta name="flags" content="image"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths"> - <style type="text/css"> - - /* Make test easier to check */ - p { display: inline; } - - /* Diagrams are scaled so that w and h line up. - Image is 75px x 75px; target dimensions will thus be 75px. */ - - /* none - * - * wmin w wmax - * |------------------+------+---------+------> width - * hmin h hmax - * |-------------+-----------+-----+----------> height - * - * target: [w, h] - */ - - #img1 {min-width: 60px; - max-width: 105px; - min-height: 45px; - max-height: 120px;} - - /* w > max-width - * wmax/w > hmin/h - * wmax w - * |------------------+------+----------------> width - * hmin h - * |------------+------------+----------------> height - * - * target: [wmax, wmax * h/w] - */ - - #img2 {max-width: 75px; /* 50% */ - min-height: 60px; /* 40% */} - - /* w > max-width - * wmax/w < hmin/h - * - * wmax w - * |-------------+-----------+----------------> width - * hmin h - * |------------------+------+----------------> height - * - * target: [wmax, hmin] - */ - - #img3 {max-width: 75px; /* 25% */ - min-height: 75px; /* 50% */} - - /* w < min-width - * wmin/w < hmax/h - * - * w wmin - * |-------------+---------+------------------> width - * h hmax - * |-------------+----------------+-----------> height - * - * target: [wmin, wmin * h/w] - */ - - #img4 {min-width: 75px; /* 300% */ - max-height: 100px; /* 400% */} - - /* w < min-width - * wmin/w > hmax/h - * - * w wmin - * |-------------+----------------+-----------> width - * h hmax - * |-------------+---------+------------------> height - * - * target: [wmin, hmax] - */ - - #img5 {min-width: 75px; /* 300% */ - max-height: 75px; /* 150% */} - - /* h > max-height - * wmin/w < hmax/h - * - * wmin w - * |------------+------------+----------------> width - * hmax h - * |------------------+------+----------------> height - * - * target: [hmax * w/h, hmax] - */ - - #img6 {min-width: 60px; /* 40% */ - max-height: 75px; /* 50% */} - - /* h > max-height - * wmin/w > hmax/h - * - * wmin w - * |------------------+------+----------------> width - * hmax h - * |-------------+-----------+----------------> height - * - * target: [wmin, hmax] - */ - - #img7 {min-width: 75px; /* 50% */ - max-height: 75px; /* 25% */} - - /* h < min-height - * wmax/w > hmin/h - * - * w wmax - * |-------------+----------------+-----------> height - * h hmin - * |-------------+---------+------------------> width - * - * target: [hmin * w/h, hmin] - */ - - #img8 {max-width: 100px; /* 400% */ - min-height: 75px; /* 300% */} - - /* w < min-width - * wmax/w < hmin/h - * - * w wmax - * |-------------+---------+------------------> width - * h hmin - * |-------------+----------------+-----------> height - * - * target: [wmax, hmin] - */ - - #img9 {max-width: 75px; /* 150% */ - min-height: 75px; /* 300% */} - - /* (w > max-width) and (h > max-height) - * (wmin/w > hmax/h) and (wmin/w > hmax/h) - * - * wmin wmax w - * |------------------+------+-------+--------> width - * hmax h - * |-------------+-------------------+--------> height - * - * target: [wmin, hmax] - */ - - #img10 { min-width: 75px; /* 25% */ - max-width: 150px; /* 50% */ - max-height: 75px; /* 20% */} - - /* (w > max-width) and (h > max-height) - * (wmax/w > hmax/h) and (wmin/w < hmax/h) - * - * wmin wmax w - * |---------+---------------+-------+--------> width - * hmax h - * |-------------+-------------------+--------> height - * - * target: [hmax * w/h, hmax] - */ - - #img11 { min-width: 25px; /* 10% */ - max-width: 225px; /* 90% */ - max-height: 75px; /* 30% */} - - /* (w > max-width) and (h > max-height) - * (wmax/w < hmax/h) and (wmax/w < hmin/h) - * - * wmax w - * |-------------+-------------------+--------> width - * hmin hmax h - * |------------------+------+-------+--------> height - * - * target: [wmax, hmin] - */ - - #img12 { max-width: 75px; /* 20% */ - min-height: 75px; /* 25% */ - max-height: 150px; /* 50% */} - - /* (w > max-width) and (h > max-width) - * (wmax/w < hmax/h) and (wmax/w > hmin/h) - * - * wmax w - * |-------------+-------------------+--------> width - * hmin hmax h - * |---------+---------------+-------+--------> height - * - * target: [wmax, wmax * h/w] - */ - - #img13 { max-width: 75px; /* 30% */ - min-height: 25px; /* 10% */ - max-height: 225px; /* 90% */} - - /* (w < min-width) and (h < min-height) - * (wmin/w < hmin/h) and (wmax/w > hmin/h) - * - * w wmin wmax - * |----------+---------+----------+----------> width - * h hmin - * |----------+-------------+-----------------> height - * - * target: [hmin * w/h, hmin] - */ - - #img14 { min-width: 50px; /* 200% */ - max-width: 100px; /* 400% */ - min-height: 75px; /* 300% */} - - /* (w < min-width) and (h < min-height) - * (wmin/w < hmin/h) and (wmax/w < hmin/h) - * - * w wmin wmax - * |----------+---------+----------+----------> width - * h hmin - * |----------+------------------------+------> height - * - * target: [wmax, hmin] - */ - - #img15 { min-width: 55px; /* 110% */ - max-width: 75px; /* 150% */ - min-height: 75px; /* 300% */} - - /* (w < min-width) and (h < min-height) - * (wmin/w > hmin/h) and (wmin/w < hmax/h) - * - * w wmin - * |----------+-------------+-----------------> width - * h hmin hmax - * |----------+---------+----------+----------> height - * - * target: [wmin, wmin * h/w] - */ - - #img16 { min-width: 75px; /* 300% */ - min-height: 50px; /* 200% */ - max-height: 100px; /* 400% */} - - /* (w < min-width) and (h < min-height) - * (wmin/w > hmin/h) and (wmin/w > hmax/h) - * w wmin - * |----------+------------------------+------> width - * h hmin hmax - * |----------+---------+----------+----------> height - * - * target: [wmin, hmax] - */ - - #img17 { min-width: 75px; /* 300% */ - min-height: 55px; /* 110% */ - max-height: 75px; /* 150% */} - - /* (w < min-width) and (h > max-height) - * - * w wmin - * |-------------------------+-----+----------> width - * hmax h - * |------------------+------+----------------> height - * - * target: [wmin, hmax] - */ - - #img18 { min-width: 75px; /* 150% */ - max-height: 75px; /* 75% */} - - /* (w > max-width) and (h < min-height) - * - * wmax w - * |------------------+------+----------------> width - * h hmin - * |-------------------------+-----+----------> height - * - * target: [wmax, hmin] - */ - - #img19 { max-width: 75px; /* 75% */ - min-height: 75px; /* 150% */} - - </style> - </head> - <body> - <div>All twenty images should be identically square.</div> - <p><img src="resources/replaced-min-max.png" alt="FAIL" title="Test 0"></p> <!-- Control --> - <p><img src="resources/replaced-min-max-1.png" alt="FAIL" title="Test 1" id="img1"></p> <!-- Wi=75, Hi=75 --> - <p><img src="resources/replaced-min-max-2.png" alt="FAIL" title="Test 2" id="img2"></p> <!-- Wi=150, Hi=150 --> - <p><img src="resources/replaced-min-max-3.png" alt="FAIL" title="Test 3" id="img3"></p> <!-- Wi=300, Hi=150 --> - <p><img src="resources/replaced-min-max-4.png" alt="FAIL" title="Test 4" id="img4"></p> <!-- Wi=25, Hi=25 --> - <p><img src="resources/replaced-min-max-5.png" alt="FAIL" title="Test 5" id="img5"></p> <!-- Wi=25, Hi=50 --> - <p><img src="resources/replaced-min-max-6.png" alt="FAIL" title="Test 6" id="img6"></p> <!-- Wi=150, Hi=150 --> - <p><img src="resources/replaced-min-max-7.png" alt="FAIL" title="Test 7" id="img7"></p> <!-- Wi=150, Hi=300 --> - <p><img src="resources/replaced-min-max-8.png" alt="FAIL" title="Test 8" id="img8"></p> <!-- Wi=25, Hi=25 --> - <p><img src="resources/replaced-min-max-9.png" alt="FAIL" title="Test 9" id="img9"></p> <!-- Wi=50, Hi=25 --> - <p><img src="resources/replaced-min-max-10.png" alt="FAIL" title="Test 10" id="img10"></p> <!-- Wi=300, Hi=375 --> - <p><img src="resources/replaced-min-max-11.png" alt="FAIL" title="Test 11" id="img11"></p> <!-- Wi=250, Hi=250 --> - <p><img src="resources/replaced-min-max-12.png" alt="FAIL" title="Test 12" id="img12"></p> <!-- Wi=375, Hi=300 --> - <p><img src="resources/replaced-min-max-13.png" alt="FAIL" title="Test 13" id="img13"></p> <!-- Wi=250, Hi=250 --> - <p><img src="resources/replaced-min-max-14.png" alt="FAIL" title="Test 14" id="img14"></p> <!-- Wi=25, Hi=25 --> - <p><img src="resources/replaced-min-max-15.png" alt="FAIL" title="Test 15" id="img15"></p> <!-- Wi=50, Hi=25 --> - <p><img src="resources/replaced-min-max-16.png" alt="FAIL" title="Test 16" id="img16"></p> <!-- Wi=25, Hi=25 --> - <p><img src="resources/replaced-min-max-17.png" alt="FAIL" title="Test 17" id="img17"></p> <!-- Wi=25, Hi=50 --> - <p><img src="resources/replaced-min-max-18.png" alt="FAIL" title="Test 18" id="img18"></p> <!-- Wi=50, Hi=100 --> - <p><img src="resources/replaced-min-max-19.png" alt="FAIL" title="Test 19" id="img19"></p> <!-- Wi=100, Hi=50 --> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/vertical-align-boxes-001-expected.html b/third_party/WebKit/LayoutTests/css2.1/20110323/vertical-align-boxes-001-expected.html deleted file mode 100644 index da4334b..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/vertical-align-boxes-001-expected.html +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Reference Result</title> - <script src="../../resources/ahem.js"></script> - <style type="text/css"> - .test { - height: 2em; - font: 40px/60px Ahem; color: blue; - } - - #control { - height: 40px; - margin-bottom: -18px; - } - #control2 { - height: 40px; - width: 15px; - margin-bottom: -18px; - } - - img { - background: blue; - } - </style> - </head> - <body> - <p>There should be a single blue rectangle with perfectly straight sides below.</p> - <div class="test"> - <img id="control" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="control2" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="control2" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="control2" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="control2" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="control2" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="control2" src="support/swatch-blue.png" alt="FAIL"> - </div> - - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/vertical-align-boxes-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/vertical-align-boxes-001.htm deleted file mode 100644 index b597b01..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/vertical-align-boxes-001.htm +++ /dev/null
@@ -1,75 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Vertical Alignment boxes: replaced elements</title> - <script src="../../resources/ahem.js"></script> - <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#line-height"> - <meta name="flags" content="ahem image"> - <meta name="assert" content="Vertical alignment aligns the margin box of inline replaced elements."> - <style type="text/css"> - .test { - height: 2em; - font: 40px/60px Ahem; color: blue; - } - - #control { - height: 40px; - margin-bottom: -18px; - } - #length { - vertical-align: -28px; - padding-top: 15px; - border-top: 10px solid; - margin: 10px 0; - } - #percent { - vertical-align: 50%; - padding-bottom: 15px; - border-bottom: 10px solid; - margin-bottom: -48px; - } - #text-bottom { - vertical-align: text-bottom; - padding-bottom: 10px; - border-bottom: 15px solid; - margin-bottom: -10px; - } - #text-top { - vertical-align: text-top; - padding-top: 15px; - border-top: 10px solid; - margin-top: 10px; - } - #middle { - vertical-align: middle; - padding-top: 15px; - border-top: 10px solid; - margin-bottom: -28px; - } - #baseline { - vertical-align: baseline; - padding-bottom: 10px; - border-bottom: 15px solid; - margin-bottom: -18px; - } - - img { - background: blue; - } - </style> - </head> - <body> - <p>There should be a single blue rectangle with perfectly straight sides below.</p> - <div class="test"> - <img id="control" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="baseline" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="middle" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="text-top" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="text-bottom" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="percent" src="support/swatch-blue.png" alt="FAIL"><!-- - --><img id="length" src="support/swatch-blue.png" alt="FAIL"> - </div> - - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/width-non-replaced-inline-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/width-non-replaced-inline-001.htm deleted file mode 100644 index 4e3614f..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/width-non-replaced-inline-001.htm +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Width of non-replaced inline element should be the same as its content</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property"> - <meta name="flags" content=""> - <meta name="assert" content="Content width of a non-replaced inline element is that of the rendered content."> - <style type="text/css"> - span - { - border-right: 5px solid black; - border-left: 5px solid black; - } - </style> - </head> - <body> - <p>Test passes if the left and right borders start and end where the 'Filler Text' does.</p> - <div> - <span>Filler Text Filler Text Filler Text Filler Text</span> - </div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css2.1/20110323/width-replaced-element-001.htm b/third_party/WebKit/LayoutTests/css2.1/20110323/width-replaced-element-001.htm deleted file mode 100644 index 9d615bbc..0000000 --- a/third_party/WebKit/LayoutTests/css2.1/20110323/width-replaced-element-001.htm +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>CSS Test: Scaling replaced elements with a width specified can scale the image</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> - <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property"> - <meta name="flags" content="image may"> - <meta name="assert" content="Replaced elements width may be scaled by the user agent when the value of the property is not 'auto'."> - <style type="text/css"> - div - { - position: relative; - } - div div - { - background: orange; - height: 15px; - width: 15px; - } - img - { - position: absolute; - left: 0.25in; - top: 0; - width: 1in; - } - </style> - </head> - <body> - <p>Test passes if the blue square is the same size or larger than the orange square.</p> - <div> - <div></div> - <img alt="blue 15x15" src="resources/blue15x15.png"> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-backgroundImage-expected.txt b/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-backgroundImage-expected.txt deleted file mode 100644 index e228d01af..0000000 --- a/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-backgroundImage-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -Blocked access to external URL http://dummy/bg.svg#frag1 -Blocked access to external URL http://dummy/bg.svg#frag2 -This is a testharness.js-based test. -PASS Computed background-image of generated content contains correct fragment identifier. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/url/mailto-expected.txt b/third_party/WebKit/LayoutTests/fast/url/mailto-expected.txt index dc49e919..dbfaf6c 100644 --- a/third_party/WebKit/LayoutTests/fast/url/mailto-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/url/mailto-expected.txt
@@ -8,7 +8,8 @@ PASS canonicalize('mailto:addr1 ') is 'mailto:addr1' PASS canonicalize('mailto:addr1?to=jon') is 'mailto:addr1?to=jon' PASS canonicalize('mailto:addr1,addr2') is 'mailto:addr1,addr2' -PASS canonicalize('mailto:addr1, addr2') is 'mailto:addr1, addr2' +PASS canonicalize('mailto:addr1, addr2') is 'mailto:addr1,%20addr2' +PASS canonicalize('mailto:addr1,"addr2"') is 'mailto:addr1,%22addr2%22' PASS canonicalize('mailto:addr1%2caddr2') is 'mailto:addr1%2caddr2' PASS canonicalize('mailto:𐌀') is 'mailto:%F0%90%8C%80' PASS canonicalize('mailto:addr1?') is 'mailto:addr1?'
diff --git a/third_party/WebKit/LayoutTests/fast/url/script-tests/mailto.js b/third_party/WebKit/LayoutTests/fast/url/script-tests/mailto.js index 73d2d805..f809333 100644 --- a/third_party/WebKit/LayoutTests/fast/url/script-tests/mailto.js +++ b/third_party/WebKit/LayoutTests/fast/url/script-tests/mailto.js
@@ -8,7 +8,8 @@ ["addr1 \t ", "addr1"], ["addr1?to=jon", "addr1?to=jon"], ["addr1,addr2", "addr1,addr2"], - ["addr1, addr2", "addr1, addr2"], + ["addr1, addr2", "addr1,%20addr2"], + ['addr1,"addr2"', "addr1,%22addr2%22"], ["addr1%2caddr2", "addr1%2caddr2"], // U+10300 input as UTF-16 surrogate pair, expected as escaped UTF-8
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself-expected.txt b/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself-expected.txt deleted file mode 100644 index 68316136..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ - - --------- -Frame: '<!--framePath //<!--frame0-->-->' --------- -This is a testharness.js-based test. -PASS Any iframe may call navigator.vibrate when enabled. -Harness: the test ran to completion. - - --------- -Frame: '<!--framePath //<!--frame1-->-->' --------- -This is a testharness.js-based test. -PASS No iframe may call navigator.vibrate when disabled. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/css-no-cache-revalidation-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/css-no-cache-revalidation-expected.txt deleted file mode 100644 index a781ee2..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/loading/css-no-cache-revalidation-expected.txt +++ /dev/null
@@ -1,33 +0,0 @@ -main frame - didStartProvisionalLoadForFrame -main frame - didCommitLoadForFrame -frame "A" - didStartProvisionalLoadForFrame -main frame - didFinishDocumentLoadForFrame -frame "A" - didCommitLoadForFrame -frame "A" - didFinishDocumentLoadForFrame -frame "A" - didFinishDocumentLoadForFrame -frame "A" - didHandleOnloadEventsForFrame -frame "A" - didFinishLoadForFrame -main frame - didHandleOnloadEventsForFrame -main frame - didFinishLoadForFrame -frame "B" - didStartProvisionalLoadForFrame -frame "B" - didCommitLoadForFrame -frame "B" - didFinishDocumentLoadForFrame -frame "B" - didFinishDocumentLoadForFrame -frame "B" - didHandleOnloadEventsForFrame -frame "B" - didFinishLoadForFrame -frame "A" - didStartProvisionalLoadForFrame -frame "A" - didCommitLoadForFrame -frame "A" - didFinishDocumentLoadForFrame -frame "A" - didFinishDocumentLoadForFrame -frame "A" - didHandleOnloadEventsForFrame -frame "A" - didFinishLoadForFrame -frame "B" - didStartProvisionalLoadForFrame -frame "B" - didCommitLoadForFrame -frame "B" - didFinishDocumentLoadForFrame -frame "B" - didFinishDocumentLoadForFrame -frame "B" - didHandleOnloadEventsForFrame -frame "B" - didFinishLoadForFrame -This is a testharness.js-based test. -PASS Revalidated CSS should not be unapplied on existing clients. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-async-third-party-script-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-async-third-party-script-expected.txt deleted file mode 100644 index c134cd82..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-async-third-party-script-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -main frame - didStartProvisionalLoadForFrame -main frame - didCommitLoadForFrame -main frame - didFinishDocumentLoadForFrame -main frame - didHandleOnloadEventsForFrame -main frame - didFinishLoadForFrame -This is a testharness.js-based test. -PASS Cross origin but asynchronous doc.written scripts are not blocked -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/download_only_supported_stylesheet_types-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/download_only_supported_stylesheet_types-expected.txt deleted file mode 100644 index 0eac725f..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/loading/download_only_supported_stylesheet_types-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -main frame - didStartProvisionalLoadForFrame -main frame - didCommitLoadForFrame -main frame - didFinishDocumentLoadForFrame -CONSOLE MESSAGE: line 18: http://127.0.0.1:8000/resources/testharness.js -CONSOLE MESSAGE: line 18: http://127.0.0.1:8000/resources/testharnessreport.js -CONSOLE MESSAGE: line 18: http://127.0.0.1:8000/resources/slow-script.pl?delay=500 -CONSOLE MESSAGE: line 18: http://127.0.0.1:8000/resources/dummy.css?1 -CONSOLE MESSAGE: line 18: http://127.0.0.1:8000/resources/dummy.css?3 -main frame - didHandleOnloadEventsForFrame -main frame - didFinishLoadForFrame -This is a testharness.js-based test. -PASS Makes sure that unsupported stylesheet types are neither preloaded nor loaded -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-download-after-shrink-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-download-after-shrink-expected.txt deleted file mode 100644 index d29157bd..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-download-after-shrink-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -main frame - didStartProvisionalLoadForFrame -main frame - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame -main frame - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame -main frame - didHandleOnloadEventsForFrame -main frame - didFinishLoadForFrame -This is a testharness.js-based test. -PASS Make sure that previously non-matching source based image resources are downloaded after the viewport changes. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-picture-removal-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-picture-removal-expected.txt deleted file mode 100644 index 53eff6f2..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-picture-removal-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -main frame - didStartProvisionalLoadForFrame -main frame - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame -main frame - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame -main frame - didHandleOnloadEventsForFrame -main frame - didFinishLoadForFrame -This is a testharness.js-based test. -PASS Make sure that source based image resources are not downloaded after the source is removed from the DOM. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-removal-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-removal-expected.txt deleted file mode 100644 index c491609..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-removal-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -main frame - didStartProvisionalLoadForFrame -main frame - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame -main frame - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame -main frame - didHandleOnloadEventsForFrame -main frame - didFinishLoadForFrame -This is a testharness.js-based test. -PASS Make sure that source based image resources are not downloaded after the img is removed from the DOM. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-source-removal-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-source-removal-expected.txt deleted file mode 100644 index 53eff6f2..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-no-download-after-source-removal-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -main frame - didStartProvisionalLoadForFrame -main frame - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame -main frame - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame -frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame -frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame -main frame - didHandleOnloadEventsForFrame -main frame - didFinishLoadForFrame -This is a testharness.js-based test. -PASS Make sure that source based image resources are not downloaded after the source is removed from the DOM. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/vibrate_in_same_origin_iframe_allowed-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/vibrate_in_same_origin_iframe_allowed-expected.txt deleted file mode 100644 index c938785..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/security/vibrate_in_same_origin_iframe_allowed-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ - - --------- -Frame: '<!--framePath //<!--frame0-->-->' --------- -This is a testharness.js-based test. -PASS A same-origin iframe may call navigator.vibrate. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/media/deprecated-css-selectors-expected.txt b/third_party/WebKit/LayoutTests/media/deprecated-css-selectors-expected.txt index 4d8f5316c..7018852 100644 --- a/third_party/WebKit/LayoutTests/media/deprecated-css-selectors-expected.txt +++ b/third_party/WebKit/LayoutTests/media/deprecated-css-selectors-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE WARNING: -internal-media-controls-overlay-cast-button selector is deprecated and will be removed in M59, around June 2017. See https://www.chromestatus.com/features/5714245488476160 for more details. +CONSOLE WARNING: -internal-media-controls-overlay-cast-button selector is deprecated and will be removed in M61, around September 2017. See https://www.chromestatus.com/features/5714245488476160 for more details. This is a testharness.js-based test. PASS Test that -internal-media-controls-* deprecated selectors throw a warning Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/hyphens/can-hyphenate-locale-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/hyphens/can-hyphenate-locale-expected.txt deleted file mode 100644 index 0f96bc41..0000000 --- a/third_party/WebKit/LayoutTests/platform/android/fast/text/hyphens/can-hyphenate-locale-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -PASS This test requires "internals.canHyphenate" -PASS "en-us" can hyphenate -PASS "en-gu" can hyphenate -PASS "ja-jp" cannot hyphenate -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/hyphens/hyphens-parsing-001-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/hyphens/hyphens-parsing-001-expected.txt deleted file mode 100644 index c404d82..0000000 --- a/third_party/WebKit/LayoutTests/platform/android/fast/text/hyphens/hyphens-parsing-001-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -This is a testharness.js-based test. -PASS Initial value -PASS hyphens: auto -PASS hyphens: manual -PASS hyphens: none -PASS hyphens should inherit -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js index 0ec8291..22e5a65 100644 --- a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js +++ b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
@@ -13,6 +13,38 @@ }, name, properties); } +// Returns a promise that is resolved when the next USBConnectionEvent of the +// given type is received. +function connectionEventPromise(eventType) { + return new Promise(resolve => { + let eventHandler = e => { + assert_true(e instanceof USBConnectionEvent); + navigator.usb.removeEventListener(eventType, eventHandler); + resolve(e.device); + }; + navigator.usb.addEventListener(eventType, eventHandler); + }); +} + +// Creates a fake device and returns a promise that resolves once the +// 'connect' event is fired for the fake device. The promise is resolved with +// an object containing the fake USB device and the corresponding USBDevice. +function getFakeDevice() { + let promise = connectionEventPromise('connect'); + let fakeDevice = navigator.usb.test.addFakeDevice(fakeDeviceInit); + return promise.then(device => { + return { device: device, fakeDevice: fakeDevice }; + }); +} + +// Disconnects the given device and returns a promise that is resolved when it +// is done. +function waitForDisconnect(fakeDevice) { + let promise = connectionEventPromise('disconnect'); + fakeDevice.disconnect(); + return promise; +} + function assertRejectsWithError(promise, name, message) { return promise.then(() => { assert_unreached('expected promise to reject with ' + name);
diff --git a/third_party/WebKit/LayoutTests/usb/resources/webusb-test.js b/third_party/WebKit/LayoutTests/usb/resources/webusb-test.js index 44d9aece..bec6876 100644 --- a/third_party/WebKit/LayoutTests/usb/resources/webusb-test.js +++ b/third_party/WebKit/LayoutTests/usb/resources/webusb-test.js
@@ -8,16 +8,19 @@ // // interface USBTest { // attribute EventHandler ondeviceclose; -// attribute DOMString? chosenDevice; +// attribute FakeUSBDevice? chosenDevice; // attribute FrozenArray<USBDeviceFilter>? lastFilters; // // Promise<void> initialize(); // Promise<void> attachToWindow(Window window); -// DOMString addFakeDevice(FakeUSBDeviceInit deviceInit); -// void removeFakeDevice(DOMString); +// FakeUSBDevice addFakeDevice(FakeUSBDeviceInit deviceInit); // void reset(); // }; // +// interface FakeUSBDevice { +// void disconnect(); +// }; +// // dictionary FakeUSBDeviceInit { // octet usbVersionMajor; // octet usbVersionMinor; @@ -76,6 +79,7 @@ let g_chooserService = null; let g_deviceManager = null; let g_closeListener = null; +let g_nextGuid = 0; function fakeDeviceInitToDeviceInfo(guid, init) { let deviceInfo = { @@ -347,33 +351,40 @@ this.bindingSet_ = new mojo.bindings.BindingSet(mojo.deviceManager.DeviceManager); this.devices_ = new Map(); + this.devicesByGuid_ = new Map(); this.client_ = null; + this.nextGuid_ = 0; } addBinding(handle) { this.bindingSet_.addBinding(this, handle); } - addDevice(info) { + addDevice(fakeDevice, info) { let device = { - guid: this.nextGuid_++ + "", + fakeDevice: fakeDevice, + guid: (this.nextGuid_++).toString(), info: info, bindingArray: [] }; - this.devices_.set(device.guid, device); + this.devices_.set(fakeDevice, device); + this.devicesByGuid_.set(device.guid, device); if (this.client_) this.client_.onDeviceAdded(fakeDeviceInitToDeviceInfo(device.guid, info)); - return device.guid; } - removeDevice(guid) { - let device = this.devices_.get(guid); + removeDevice(fakeDevice) { + let device = this.devices_.get(fakeDevice); + if (!device) + throw new Error('Cannot remove unknown device.'); + for (var binding of device.bindingArray) binding.close(); - this.devices_.delete(guid); + this.devices_.delete(device.fakeDevice); + this.devicesByGuid_.delete(device.guid); if (this.client_) { this.client_.onDeviceRemoved( - fakeDeviceInitToDeviceInfo(guid, device.info)); + fakeDeviceInitToDeviceInfo(device.guid, device.info)); } } @@ -385,6 +396,7 @@ fakeDeviceInitToDeviceInfo(device.guid, device.info)); }); this.devices_.clear(); + this.devicesByGuid_.clear(); } getDevices(options) { @@ -396,13 +408,13 @@ } getDevice(guid, request) { - let device = this.devices_.get(guid); + let device = this.devicesByGuid_.get(guid); if (device) { let binding = new mojo.bindings.Binding( mojo.device.Device, new FakeDevice(device.info), request); binding.setConnectionErrorHandler(() => { if (g_closeListener) - g_closeListener(guid); + g_closeListener(device.fakeDevice); }); device.bindingArray.push(binding); } else { @@ -427,13 +439,13 @@ this.bindingSet_.addBinding(this, handle); } - setChosenDevice(guid) { - this.chosenDeviceGuid_ = guid; + setChosenDevice(fakeDevice) { + this.chosenDevice_ = fakeDevice; } getPermission(deviceFilters) { this.lastFilters_ = convertMojoDeviceFilters(deviceFilters); - let device = g_deviceManager.devices_.get(this.chosenDeviceGuid_); + let device = g_deviceManager.devices_.get(this.chosenDevice_); if (device) { return Promise.resolve({ result: fakeDeviceInitToDeviceInfo(device.guid, device.info) @@ -444,6 +456,13 @@ } } +// Unlike FakeDevice this class is exported to callers of USBTest.addFakeDevice. +class FakeUSBDevice { + disconnect() { + setTimeout(() => g_deviceManager.removeDevice(this), 0); + } +} + class USBTest { constructor() {} @@ -522,25 +541,23 @@ if (!g_deviceManager) throw new Error('Call initialize() before addFakeDevice().'); - return g_deviceManager.addDevice(deviceInit); - } - - removeFakeDevice(guid) { - if (!g_deviceManager) - throw new Error('Call initialize() before removeFakeDevice().'); - - return g_deviceManager.removeDevice(guid); + // |addDevice| and |removeDevice| are called in a setTimeout callback so + // that tests do not rely on the device being immediately available which + // may not be true for all implementations of this test API. + let fakeDevice = new FakeUSBDevice(); + setTimeout(() => g_deviceManager.addDevice(fakeDevice, deviceInit), 0); + return fakeDevice; } set ondeviceclose(func) { g_closeListener = func; } - set chosenDevice(guid) { + set chosenDevice(fakeDevice) { if (!g_chooserService) throw new Error('Call initialize() before setting chosenDevice.'); - g_chooserService.setChosenDevice(guid); + g_chooserService.setChosenDevice(fakeDevice); } get lastFilters() {
diff --git a/third_party/WebKit/LayoutTests/usb/usb-connection-event.html b/third_party/WebKit/LayoutTests/usb/usb-connection-event.html index 6133f1b..3bc65c4 100644 --- a/third_party/WebKit/LayoutTests/usb/usb-connection-event.html +++ b/third_party/WebKit/LayoutTests/usb/usb-connection-event.html
@@ -8,13 +8,10 @@ 'use strict'; usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let evt = new USBConnectionEvent('connect', { device: devices[0] }); + return getFakeDevice().then(({ device }) => { + let evt = new USBConnectionEvent('connect', { device: device }); assert_equals(evt.type, 'connect'); - assert_equals(evt.device, devices[0]); + assert_equals(evt.device, device); }); }, 'Can construct a USBConnectionEvent with a device');
diff --git a/third_party/WebKit/LayoutTests/usb/usb.html b/third_party/WebKit/LayoutTests/usb/usb.html index 82bc0f5a..16c659c 100644 --- a/third_party/WebKit/LayoutTests/usb/usb.html +++ b/third_party/WebKit/LayoutTests/usb/usb.html
@@ -7,35 +7,23 @@ <script> 'use strict'; -// Returns a promise that is resolved when the next USBConnectionEvent of the -// given type is received. -function connectionEventPromise(eventType) { - return new Promise(resolve => { - let eventHandler = e => { - assert_true(e instanceof USBConnectionEvent); - navigator.usb.removeEventListener(eventType, eventHandler); - resolve(e.device); - }; - navigator.usb.addEventListener(eventType, eventHandler); +usb_test(() => { + return getFakeDevice().then(({ device }) => { + return navigator.usb.getDevices().then(devices => { + assert_equals(devices.length, 1); + assert_equals(device, devices[0]); + assertDeviceInfoEquals(devices[0], fakeDeviceInit); + }); }); -} +}, 'getDevices returns devices that are connected'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - assertDeviceInfoEquals(devices[0], fakeDeviceInit); - }); -}, 'getDevices returns devices exposed by the DeviceManager service'); - -usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devicesFirstTime => { - assert_equals(devicesFirstTime.length, 1); - return navigator.usb.getDevices().then(devicesSecondTime => { - assert_array_equals(devicesSecondTime, devicesFirstTime); + return getFakeDevice().then(() => { + return navigator.usb.getDevices().then(devicesFirstTime => { + assert_equals(devicesFirstTime.length, 1); + return navigator.usb.getDevices().then(devicesSecondTime => { + assert_array_equals(devicesSecondTime, devicesFirstTime); + }); }); }); }, 'getDevices returns the same objects for each USB device'); @@ -62,26 +50,29 @@ }, 'requestDevice rejects when no device is chosen'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - navigator.usb.test.chosenDevice = guid; - - return callWithKeyDown(() => navigator.usb.requestDevice({ filters: [] }) - .then(device => { - assertDeviceInfoEquals(device, fakeDeviceInit); - }) - ); + return getFakeDevice().then(({ device, fakeDevice }) => { + navigator.usb.test.chosenDevice = fakeDevice; + return callWithKeyDown(() => { + return navigator.usb.requestDevice({ filters: [] }).then(chosenDevice => { + assert_equals(chosenDevice, device); + }); + }); + }); }, 'requestDevice returns the device chosen by the user'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - navigator.usb.test.chosenDevice = guid; - - return callWithKeyDown(() => navigator.usb.requestDevice({ filters: [] }) - .then(device => navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - assert_equals(devices[0], device); - })) - ); + return getFakeDevice().then(({ device, fakeDevice }) => { + navigator.usb.test.chosenDevice = fakeDevice; + return callWithKeyDown(() => { + return navigator.usb.requestDevice({ filters: [] }).then(chosenDevice => { + assert_equals(chosenDevice, device); + return navigator.usb.getDevices().then(devices => { + assert_equals(devices.length, 1); + assert_equals(devices[0], chosenDevice); + }); + }); + }); + }); }, 'getDevices returns the same object as requestDevice'); usb_test(() => { @@ -105,34 +96,15 @@ }, 'filters are sent correctly'); usb_test(() => { - let promise = connectionEventPromise('connect'); - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return promise.then(device => { + return getFakeDevice().then(({ device }) => { assertDeviceInfoEquals(device, fakeDeviceInit); return device.open().then(() => device.close()); }); }, 'onconnect event is trigged by adding a device'); usb_test(usb => { - let promise = connectionEventPromise('connect'); - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return promise - .then(device => navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - assert_equals(devices[0], device); - })); -}, 'getDevices returns the same object as sent in the onconnect event'); - -usb_test(usb => { - let deviceAdded = connectionEventPromise('connect'); - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return deviceAdded.then(device => { - let deviceRemoved = connectionEventPromise('disconnect'); - navigator.usb.test.removeFakeDevice(guid); - return deviceRemoved.then(removedDevice => { + return getFakeDevice().then(({ device, fakeDevice }) => { + return waitForDisconnect(fakeDevice).then(removedDevice => { assertDeviceInfoEquals(removedDevice, fakeDeviceInit); assert_equals(removedDevice, device); return removedDevice.open().then(() => {
diff --git a/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html b/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html index b63743d..b6514072 100644 --- a/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html +++ b/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html
@@ -11,7 +11,7 @@ return navigator.usb.test.initialize().then(() => { return new Promise((resolve, reject) => { let opened = false; - let fakeDeviceGuid = null; + let fakeDevice = null; let iframe = document.createElement('iframe'); iframe.src = 'resources/open-in-iframe.html'; @@ -23,7 +23,7 @@ window.onmessage = messageEvent => { if (messageEvent.data == 'Ready') { - fakeDeviceGuid = navigator.usb.test.addFakeDevice(fakeDeviceInit); + fakeDevice = navigator.usb.test.addFakeDevice(fakeDeviceInit); } else if (messageEvent.data == 'Success') { opened = true; onDeviceConnected(iframe); @@ -32,8 +32,8 @@ } }; - navigator.usb.test.ondeviceclose = guid => { - assert_equals(guid, fakeDeviceGuid); + navigator.usb.test.ondeviceclose = closedFakeDevice => { + assert_equals(closedFakeDevice, fakeDevice); assert_true(opened); resolve(); };
diff --git a/third_party/WebKit/LayoutTests/usb/usbDevice.html b/third_party/WebKit/LayoutTests/usb/usbDevice.html index 5746c7e..56a467ef 100644 --- a/third_party/WebKit/LayoutTests/usb/usbDevice.html +++ b/third_party/WebKit/LayoutTests/usb/usbDevice.html
@@ -23,33 +23,24 @@ } usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(devices[0].open()); + return getFakeDevice().then(({ device, fakeDevice }) => { + return waitForDisconnect(fakeDevice) + .then(() => assertRejectsWithNotFoundError(device.open())); }); }, 'open rejects when called on a disconnected device'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let promise = devices[0].open(); - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(promise) - .then(() => runGarbageCollection()); + return getFakeDevice().then(({ device, fakeDevice }) => { + return device.open() + .then(() => waitForDisconnect(fakeDevice)) + .then(() => { + assert_false(device.opened); + }); }); -}, 'open rejects when device disconnected during call'); +}, 'disconnection closes the device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { assert_false(device.opened); return device.open().then(() => { assert_true(device.opened); @@ -57,15 +48,11 @@ assert_false(device.opened); }); }); - }).then(() => runGarbageCollection()); + }); }, 'a device can be opened and closed'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.open()) .then(() => device.open()) @@ -78,11 +65,7 @@ }, 'open and close can be called multiple times'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { const message = 'An operation that changes the device state is in progress.'; return Promise.all([ @@ -98,75 +81,54 @@ }, 'open and close cannot be called again while open or close are in progress'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; - return device.open().then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.close()); - }); + return getFakeDevice().then(({ device, fakeDevice }) => { + return device.open() + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.close())); }); }, 'close rejects when called on a disconnected device'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.selectConfiguration(1)); - }); + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.selectConfiguration(1))); }); }, 'selectConfiguration rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; - return Promise.all([ - assertRejectsWithNotOpenError(device.selectConfiguration(1)), - assertRejectsWithNotOpenError(device.claimInterface(0)), - assertRejectsWithNotOpenError(device.releaseInterface(0)), - assertRejectsWithNotOpenError(device.selectAlternateInterface(0, 1)), - assertRejectsWithNotOpenError(device.controlTransferIn({ - requestType: 'vendor', - recipient: 'device', - request: 0x42, - value: 0x1234, - index: 0x5678 - }, 7)), - assertRejectsWithNotOpenError(device.controlTransferOut({ - requestType: 'vendor', - recipient: 'device', - request: 0x42, - value: 0x1234, - index: 0x5678 - }, new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]))), - assertRejectsWithNotOpenError(device.clearHalt('in', 1)), - assertRejectsWithNotOpenError(device.transferIn(1, 8)), - assertRejectsWithNotOpenError( - device.transferOut(1, new ArrayBuffer(8))), - assertRejectsWithNotOpenError(device.isochronousTransferIn(1, [8])), - assertRejectsWithNotOpenError( - device.isochronousTransferOut(1, new ArrayBuffer(8), [8])), - assertRejectsWithNotOpenError(device.reset()) - ]); - }); + return getFakeDevice().then(({ device }) => Promise.all([ + assertRejectsWithNotOpenError(device.selectConfiguration(1)), + assertRejectsWithNotOpenError(device.claimInterface(0)), + assertRejectsWithNotOpenError(device.releaseInterface(0)), + assertRejectsWithNotOpenError(device.selectAlternateInterface(0, 1)), + assertRejectsWithNotOpenError(device.controlTransferIn({ + requestType: 'vendor', + recipient: 'device', + request: 0x42, + value: 0x1234, + index: 0x5678 + }, 7)), + assertRejectsWithNotOpenError(device.controlTransferOut({ + requestType: 'vendor', + recipient: 'device', + request: 0x42, + value: 0x1234, + index: 0x5678 + }, new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]))), + assertRejectsWithNotOpenError(device.clearHalt('in', 1)), + assertRejectsWithNotOpenError(device.transferIn(1, 8)), + assertRejectsWithNotOpenError( + device.transferOut(1, new ArrayBuffer(8))), + assertRejectsWithNotOpenError(device.isochronousTransferIn(1, [8])), + assertRejectsWithNotOpenError( + device.isochronousTransferOut(1, new ArrayBuffer(8), [8])), + assertRejectsWithNotOpenError(device.reset()) + ])); }, 'methods requiring it reject when the device is not open'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { assert_equals(device.configuration, null); return device.open() .then(() => { @@ -182,11 +144,7 @@ }, 'device configuration can be set and queried'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { assert_equals(device.configuration, null); return device.open() .then(() => assertRejectsWithError( @@ -197,11 +155,7 @@ }, 'selectConfiguration rejects on invalid configurations'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { assert_equals(device.configuration, null); return device.open().then(() => Promise.all([ assertRejectsWithNotConfiguredError(device.claimInterface(0)), @@ -234,11 +188,7 @@ }, 'methods requiring it reject when the device is unconfigured'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(0)) @@ -254,11 +204,7 @@ }, 'an interface can be claimed and released'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(0)) @@ -273,11 +219,7 @@ }, 'interfaces are released on close'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { const message = 'The interface number provided is not supported by the ' + 'device in its current configuration.'; return device.open() @@ -293,42 +235,26 @@ }, 'a non-existent interface cannot be claimed or released'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - var device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(1)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.claimInterface(0)); - }); + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.claimInterface(0))); }); }, 'claimInterface rejects when called on a disconnected device'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - var device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(0)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.releaseInterface(0)); - }); + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.releaseInterface(0))); }); }, 'releaseInterface rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(2)) .then(() => device.claimInterface(0)) @@ -338,11 +264,7 @@ }, 'can select an alternate interface'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(2)) .then(() => device.claimInterface(0)) @@ -355,27 +277,17 @@ }, 'cannot select a non-existent alternate interface'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - var device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(2)) .then(() => device.claimInterface(0)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.selectAlternateInterface(0, 1)); - }); + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.selectAlternateInterface(0, 1))); }); }, 'selectAlternateInterface rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.controlTransferIn({ @@ -399,32 +311,22 @@ }, 'can issue IN control transfer'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(1)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.controlTransferIn({ + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.controlTransferIn({ requestType: 'vendor', recipient: 'device', request: 0x42, value: 0x1234, index: 0x5678 - }, 7)); - }); + }, 7))); }); }, 'controlTransferIn rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.controlTransferOut({ @@ -444,32 +346,22 @@ }, 'can issue OUT control transfer'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(1)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.controlTransferOut({ + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.controlTransferOut({ requestType: 'vendor', recipient: 'device', request: 0x42, value: 0x1234, index: 0x5678 - }, new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]))); - }); + }, new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8])))); }); }, 'controlTransferOut rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { let interfaceRequest = { requestType: 'vendor', recipient: 'interface', @@ -529,11 +421,7 @@ }, 'requests to interfaces and endpoint require an interface claim'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(0)) @@ -543,27 +431,17 @@ }, 'can clear a halt condition'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(0)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.clearHalt('in', 1)); - }); + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.clearHalt('in', 1))); }); }, 'clearHalt rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { let data = new DataView(new ArrayBuffer(1024)); for (let i = 0; i < 1024; ++i) data.setUint8(i, i & 0xff); @@ -591,11 +469,7 @@ }, 'transfers to unavailable endpoints are rejected'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(0)) @@ -612,11 +486,7 @@ }, 'can issue IN interrupt transfer'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(1)) @@ -634,27 +504,17 @@ }, 'can issue IN bulk transfer'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(1)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.transferIn(2, 1024)); - }); + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.transferIn(2, 1024))); }); }, 'transferIn rejects if called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(1)) @@ -674,11 +534,7 @@ }, 'can issue OUT bulk transfer'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(1)) .then(() => device.claimInterface(1)) @@ -686,18 +542,14 @@ let data = new DataView(new ArrayBuffer(1024)); for (let i = 0; i < 1024; ++i) data.setUint8(i, i & 0xff); - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.transferOut(2, data)); + return waitForDisconnect(fakeDevice) + .then(() => assertRejectsWithNotFoundError(device.transferOut(2, data))); }); }); }, 'transferOut rejects if called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(2)) .then(() => device.claimInterface(0)) @@ -727,29 +579,19 @@ }, 'can issue IN isochronous transfer'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(2)) .then(() => device.claimInterface(0)) .then(() => device.selectAlternateInterface(0, 1)) - .then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.isochronousTransferIn( - 1, [64, 64, 64, 64, 64, 64, 64, 64])); - }); + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.isochronousTransferIn( + 1, [64, 64, 64, 64, 64, 64, 64, 64]))); }); }, 'isochronousTransferIn rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open() .then(() => device.selectConfiguration(2)) .then(() => device.claimInterface(0)) @@ -779,11 +621,7 @@ }, 'can issue OUT isochronous transfer'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(devices.length, 1); - let device = devices[0]; + return getFakeDevice().then(({ device, fakeDevice }) => { return device.open() .then(() => device.selectConfiguration(2)) .then(() => device.claimInterface(0)) @@ -794,33 +632,24 @@ for (let j = 0; j < 64; ++j) data.setUint8(i * j, j & 0xff); } - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.isochronousTransferOut( - 1, data, [64, 64, 64, 64, 64, 64, 64, 64])); + return waitForDisconnect(fakeDevice) + .then(() => assertRejectsWithNotFoundError(device.isochronousTransferOut( + 1, data, [64, 64, 64, 64, 64, 64, 64, 64]))); }); }); }, 'isochronousTransferOut rejects when called on a disconnected device'); usb_test(() => { - navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; + return getFakeDevice().then(({ device }) => { return device.open().then(() => device.reset()).then(() => device.close()); }); }, 'can reset the device'); usb_test(() => { - let guid = navigator.usb.test.addFakeDevice(fakeDeviceInit); - - return navigator.usb.getDevices().then(devices => { - assert_equals(1, devices.length); - let device = devices[0]; - return device.open().then(() => { - navigator.usb.test.removeFakeDevice(guid); - return assertRejectsWithNotFoundError(device.reset()); - }); + return getFakeDevice().then(({ device, fakeDevice }) => { + return device.open() + .then(() => waitForDisconnect(fakeDevice)) + .then(() => assertRejectsWithNotFoundError(device.reset())); }); }, 'resetDevice rejects when called on a disconnected device'); </script>
diff --git a/third_party/WebKit/LayoutTests/virtual/layout_ng/css2.1/20110323/README.txt b/third_party/WebKit/LayoutTests/virtual/layout_ng/css2.1/20110323/README.txt deleted file mode 100644 index 5c91a6e..0000000 --- a/third_party/WebKit/LayoutTests/virtual/layout_ng/css2.1/20110323/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in css2.1/20110323 with -# --enable-blink-features=LayoutNG. -# The LayoutNG project is described here: http://goo.gl/1hwhfX
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp index d8151fc..2563233 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
@@ -53,15 +53,4 @@ per_context_data_ = nullptr; } -ScriptValue ScriptState::GetFromExtrasExports(const char* name) { - v8::HandleScope handle_scope(isolate_); - v8::Local<v8::Value> v8_value; - if (!GetContext() - ->GetExtrasBindingObject() - ->Get(GetContext(), V8AtomicString(GetIsolate(), name)) - .ToLocal(&v8_value)) - return ScriptValue(); - return ScriptValue(this, v8_value); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h index de6358c4..ba02bfad 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
@@ -149,8 +149,6 @@ V8PerContextData* PerContextData() const { return per_context_data_.get(); } void DisposePerContextData(); - ScriptValue GetFromExtrasExports(const char* name); - protected: ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>);
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp index bddcca1..f662e64 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -731,4 +731,21 @@ CallInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); } +v8::MaybeLocal<v8::Value> V8ScriptRunner::CallExtraHelper( + ScriptState* script_state, + const char* name, + size_t num_args, + v8::Local<v8::Value>* args) { + v8::Isolate* isolate = script_state->GetIsolate(); + v8::Local<v8::Value> function_value; + v8::Local<v8::Context> context = script_state->GetContext(); + if (!context->GetExtrasBindingObject() + ->Get(context, V8AtomicString(isolate, name)) + .ToLocal(&function_value)) + return v8::MaybeLocal<v8::Value>(); + v8::Local<v8::Function> function = function_value.As<v8::Function>(); + return V8ScriptRunner::CallInternalFunction(function, v8::Undefined(isolate), + num_args, args, isolate); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h index 8cfb3906..4629a20 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
@@ -143,20 +143,10 @@ const v8::ScriptOrigin&); private: - static v8::MaybeLocal<v8::Value> CallExtraHelper(ScriptState* script_state, + static v8::MaybeLocal<v8::Value> CallExtraHelper(ScriptState*, const char* name, size_t num_args, - v8::Local<v8::Value>* args) { - v8::Isolate* isolate = script_state->GetIsolate(); - v8::Local<v8::Value> undefined = v8::Undefined(isolate); - v8::Local<v8::Value> function_value = - script_state->GetFromExtrasExports(name).V8Value(); - if (function_value.IsEmpty()) - return v8::MaybeLocal<v8::Value>(); - v8::Local<v8::Function> function = function_value.As<v8::Function>(); - return V8ScriptRunner::CallInternalFunction(function, undefined, num_args, - args, isolate); - } + v8::Local<v8::Value>* args); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/Deprecation.cpp b/third_party/WebKit/Source/core/frame/Deprecation.cpp index 7d27ec7..c754219 100644 --- a/third_party/WebKit/Source/core/frame/Deprecation.cpp +++ b/third_party/WebKit/Source/core/frame/Deprecation.cpp
@@ -382,7 +382,7 @@ case UseCounter::kCSSSelectorInternalMediaControlsOverlayCastButton: return willBeRemoved( - "-internal-media-controls-overlay-cast-button selector", M59, + "-internal-media-controls-overlay-cast-button selector", M61, "5714245488476160"); case UseCounter::kCSSZoomReset:
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index ce2c72bc..c82c64a7 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1576,6 +1576,8 @@ kViewportFixedPositionUnderFilter = 1961, kRequestMIDIAccessWithSysExOption = 1962, kRequestMIDIAccessIframeWithSysExOption = 1963, + kGamepadAxes = 1964, + kGamepadButtons = 1965, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js index 0abeced..4d2d9a8 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
@@ -149,7 +149,6 @@ this._deviceScaleItem.setTitle(Common.UIString('Device pixel ratio')); this._deviceScaleItem.setGlyph(''); this._deviceScaleItem.turnIntoSelect(); - this._deviceScaleItem.element.style.padding = '0 5px'; toolbar.appendToolbarItem(this._deviceScaleItem); toolbar.appendToolbarItem( @@ -159,7 +158,6 @@ this._uaItem.setTitle(Common.UIString('Device type')); this._uaItem.setGlyph(''); this._uaItem.turnIntoSelect(); - this._uaItem.element.style.padding = '0 5px'; toolbar.appendToolbarItem(this._uaItem); } @@ -181,7 +179,6 @@ this._networkConditionsItem = NetworkConditions.NetworkConditionsSelector.createToolbarMenuButton(); this._networkConditionsItem.setVisible(this._showNetworkConditionsSetting.get()); this._networkConditionsItem.setTitle(Common.UIString('Network throttling')); - this._networkConditionsItem.element.style.padding = '0 5px'; this._networkConditionsItem.element.style.maxWidth = '140px'; toolbar.appendToolbarItem(this._networkConditionsItem);
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js index 16c94cea..20d24b1 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js
@@ -10,7 +10,8 @@ super(); this.registerRequiredCSS('components/breakpointsList.css'); - this._eventListenerBreakpointsSetting = Common.settings.createLocalSetting('eventListenerBreakpoints', []); + this._eventListenerBreakpointsSetting = + Common.settings.createSetting('eventListenerBreakpoints', [], Common.SettingStorageType.Session); this._categoriesTreeOutline = new UI.TreeOutlineInShadow(); this._categoriesTreeOutline.element.tabIndex = 0;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css b/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css index f7a09738..3958872b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css
@@ -80,7 +80,6 @@ .toolbar-has-dropdown { justify-content: space-between; padding: 0 3px 0 5px; - margin: 0 -3px 0 -5px; } .toolbar-has-dropdown .toolbar-text {
diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h index a6021ba..3a45569 100644 --- a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h +++ b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h
@@ -321,7 +321,7 @@ BLINK_FROM_HERE, CrossThreadBind(&Self::SignalDone, WrapPassRefPtr(this))); } - void DidGetReadable() override { ASSERT_NOT_REACHED(); } + void DidGetReadable() override { NOTREACHED(); } std::unique_ptr<WebDataConsumerHandle> handle_; };
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp index f0c2fdc5..abbbf8b 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -382,7 +382,7 @@ // origin. switch (request_->Mode()) { case WebURLRequest::kFetchRequestModeSameOrigin: - ASSERT_NOT_REACHED(); + NOTREACHED(); break; case WebURLRequest::kFetchRequestModeNoCORS: tainting = FetchRequestData::kOpaqueTainting;
diff --git a/third_party/WebKit/Source/modules/fetch/Request.cpp b/third_party/WebKit/Source/modules/fetch/Request.cpp index de68928..0b1ebcc 100644 --- a/third_party/WebKit/Source/modules/fetch/Request.cpp +++ b/third_party/WebKit/Source/modules/fetch/Request.cpp
@@ -581,7 +581,7 @@ case WebURLRequest::kRequestContextXSLT: return "xslt"; } - ASSERT_NOT_REACHED(); + NOTREACHED(); return ""; } @@ -613,7 +613,7 @@ DCHECK(RuntimeEnabledFeatures::reducedReferrerGranularityEnabled()); return "no-referrer-when-downgrade-origin-when-cross-origin"; } - ASSERT_NOT_REACHED(); + NOTREACHED(); return String(); } @@ -631,7 +631,7 @@ case WebURLRequest::kFetchRequestModeNavigate: return "navigate"; } - ASSERT_NOT_REACHED(); + NOTREACHED(); return ""; } @@ -649,7 +649,7 @@ case WebURLRequest::kFetchCredentialsModePassword: return "password"; } - ASSERT_NOT_REACHED(); + NOTREACHED(); return ""; } @@ -683,7 +683,7 @@ case WebURLRequest::kFetchRedirectModeManual: return "manual"; } - ASSERT_NOT_REACHED(); + NOTREACHED(); return ""; }
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp index f33ff899..eb16c9c 100644 --- a/third_party/WebKit/Source/modules/fetch/Response.cpp +++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -335,7 +335,7 @@ case FetchResponseData::kOpaqueRedirectType: return "opaqueredirect"; } - ASSERT_NOT_REACHED(); + NOTREACHED(); return ""; }
diff --git a/third_party/WebKit/Source/modules/gamepad/Gamepad.idl b/third_party/WebKit/Source/modules/gamepad/Gamepad.idl index 8756cb4..927bb17e 100644 --- a/third_party/WebKit/Source/modules/gamepad/Gamepad.idl +++ b/third_party/WebKit/Source/modules/gamepad/Gamepad.idl
@@ -37,8 +37,8 @@ readonly attribute unsigned long long timestamp; readonly attribute DOMString mapping; // https://github.com/w3c/gamepad/issues/28 - readonly attribute double[] axes; - readonly attribute GamepadButton[] buttons; + [MeasureAs=GamepadAxes] readonly attribute double[] axes; + [MeasureAs=GamepadButtons] readonly attribute GamepadButton[] buttons; [OriginTrialEnabled=GamepadExtensions, MeasureAs=GamepadPose] readonly attribute GamepadPose? pose; [OriginTrialEnabled=GamepadExtensions, MeasureAs=GamepadHand] readonly attribute GamepadHand hand;
diff --git a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp index ca93ddc..6832f67d 100644 --- a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp +++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
@@ -636,7 +636,8 @@ settings_.setZoom(capabilities.zoom->current); } - capabilities_.setTorch(capabilities.supports_torch); + if (capabilities.supports_torch) + capabilities_.setTorch(capabilities.supports_torch); if (capabilities.supports_torch) settings_.setTorch(capabilities.torch); }
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp index ceee1a9..c57bc38 100644 --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
@@ -26,7 +26,7 @@ "{\"fullscreen\": [\"" ORIGIN_A "\"], \"payment\": [\"self\"]}", "{\"fullscreen\": [\"" ORIGIN_A "\"]}, {\"payment\": [\"self\"]}"}; -const char* g_k_invalid_policies[] = { +const char* const kInvalidPolicies[] = { "Not A JSON literal", "\"Not a JSON object\"", "[\"Also\", \"Not a JSON object\"]", @@ -59,7 +59,7 @@ TEST_F(FeaturePolicyTest, ParseInvalidPolicy) { Vector<String> messages; - for (const char* policy_string : g_k_invalid_policies) { + for (const char* policy_string : kInvalidPolicies) { messages.Clear(); ParseFeaturePolicy(policy_string, origin_a_.Get(), &messages); EXPECT_NE(0UL, messages.size());
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp index 419f214..9f43a3f 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
@@ -309,8 +309,8 @@ RunTest("Blink.DecodedImage.Orientation"); } -DecodedImageOrientationHistogramTest::ParamType - g_k_decoded_image_orientation_histogram_test_params[] = { +const DecodedImageOrientationHistogramTest::ParamType + kDecodedImageOrientationHistogramTestParams[] = { {"/LayoutTests/images/resources/exif-orientation-1-ul.jpg", kOriginTopLeft}, {"/LayoutTests/images/resources/exif-orientation-2-ur.jpg", @@ -331,6 +331,6 @@ INSTANTIATE_TEST_CASE_P( DecodedImageOrientationHistogramTest, DecodedImageOrientationHistogramTest, - ::testing::ValuesIn(g_k_decoded_image_orientation_histogram_test_params)); + ::testing::ValuesIn(kDecodedImageOrientationHistogramTestParams)); } // namespace blink
diff --git a/third_party/WebKit/Source/platform/mac/GraphicsContextCanvas.mm b/third_party/WebKit/Source/platform/mac/GraphicsContextCanvas.mm index e3862ec..190a6fc 100644 --- a/third_party/WebKit/Source/platform/mac/GraphicsContextCanvas.mm +++ b/third_party/WebKit/Source/platform/mac/GraphicsContextCanvas.mm
@@ -76,11 +76,6 @@ // remember the top/left, in case we need to compose this later bitmap_offset_.set(clip_bounds.x(), clip_bounds.y()); - // Now make clip_bounds be relative to the current layer/device - if (!bitmap_is_dummy_) { - canvas_->temporary_internal_describeTopLayer(nullptr, &clip_bounds); - } - SkPixmap device_pixels; ToPixmap(canvas_, &device_pixels);
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp index a8c2268..b978eec 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
@@ -209,7 +209,7 @@ // Horizontally flip the canvas if it is left vertical scrollbar. if (scrollbar.IsLeftSideVerticalScrollbar()) { canvas->save(); - canvas->translate(canvas->getBaseLayerSize().width(), 0); + canvas->translate(rect.Width(), 0); canvas->scale(-1, 1); }
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/executive_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/executive_mock.py index 670b728..2b910bc 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/executive_mock.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/executive_mock.py
@@ -56,6 +56,9 @@ def communicate(self, *_): return (self.stdout.getvalue(), self.stderr.getvalue()) + def kill(self): + return + class MockExecutive(object): PIPE = 'MOCK PIPE'
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py index 6a792fc..6b261b5 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
@@ -325,6 +325,8 @@ self._delete_dirs(results_directories[:-self.ARCHIVED_RESULTS_LIMIT]) def _set_up_run(self, test_names): + exit_code = self._port.setup_test_run() + self._printer.write_update("Checking build ...") if self._options.build: exit_code = self._port.check_build(self._needs_servers(test_names), self._printer) @@ -332,13 +334,6 @@ _log.error("Build check failed") return exit_code - # Check that the system dependencies (themes, fonts, ...) are correct. - if not self._options.nocheck_sys_deps: - self._printer.write_update("Checking system dependencies ...") - exit_code = self._port.check_sys_deps(self._needs_servers(test_names)) - if exit_code: - return exit_code - if self._options.clobber_old_results: self._clobber_old_results() elif self._filesystem.exists(self._results_directory): @@ -349,7 +344,13 @@ # Create the output directory if it doesn't already exist. self._port.host.filesystem.maybe_make_directory(self._results_directory) - self._port.setup_test_run() + # Check that the system dependencies (themes, fonts, ...) are correct. + if not self._options.nocheck_sys_deps: + self._printer.write_update("Checking system dependencies ...") + exit_code = self._port.check_sys_deps(self._needs_servers(test_names)) + if exit_code: + return exit_code + return exit_codes.OK_EXIT_STATUS def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations,
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py index 28c22b4..da1121b 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py
@@ -65,6 +65,7 @@ if not self.get_option('disable_breakpad'): self._dump_reader = DumpReaderLinux(host, self._build_path()) self._original_home = None + self._xvfb_process = None def additional_driver_flag(self): flags = super(LinuxPort, self).additional_driver_flag() @@ -104,10 +105,12 @@ def setup_test_run(self): super(LinuxPort, self).setup_test_run() + self._start_xvfb() self._setup_dummy_home_dir() def clean_up_test_run(self): super(LinuxPort, self).clean_up_test_run() + self._stop_xvfb() self._clean_up_dummy_home_dir() # @@ -142,6 +145,45 @@ self._filesystem.rmtree(dummy_home) self.host.environ['HOME'] = self._original_home + def _start_xvfb(self): + display = self._find_display() + if not display: + _log.warn('Failed to find a free display to start Xvfb.') + return + + _log.info('Starting Xvfb with display "%s".', display) + self._xvfb_process = self.host.executive.popen( + ['Xvfb', display, '-screen', '0', '1280x800x24', '-ac', '-dpi', '96'], + stderr=self.host.executive.DEVNULL) + + # By setting DISPLAY here, the individual worker processes will + # get the right DISPLAY. Note, if this environment could be passed + # when creating workers, then we wouldn't need to modify DISPLAY here. + self.host.environ['DISPLAY'] = display + + # The poll() method will return None if the process has not terminated: + # https://docs.python.org/2/library/subprocess.html#subprocess.Popen.poll + if self._xvfb_process.poll() is not None: + _log.warn('Failed to start Xvfb on display "%s."', display) + + def _find_display(self): + """Tries to find a free X display, looping if necessary.""" + # The "xvfb-run" command uses :99 by default. + for display_number in range(99, 120): + display = ':%d' % display_number + exit_code = self.host.executive.run_command( + ['xdpyinfo', '-display', display], return_exit_code=True) + if exit_code == 1: + return display + return None + + def _stop_xvfb(self): + if not self._xvfb_process: + return + _log.debug('Killing Xvfb process pid %d.', self._xvfb_process.pid) + self._xvfb_process.kill() + self._xvfb_process.wait() + def _path_to_driver(self, target=None): binary_name = self.driver_name() return self._build_path_with_target(target, binary_name)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py index fe363f7..9b6a25e5 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py
@@ -114,3 +114,33 @@ port.clean_up_test_run() self.assertEqual(port.host.environ['HOME'], '/home/user') self.assertFalse(port.host.filesystem.exists(temp_home_dir)) + + def test_setup_test_run_starts_xvfb(self): + port = self.make_port() + port.host.executive = MockExecutive(exit_code=1) + port.setup_test_run() + self.assertEqual( + port.host.executive.calls, + [ + ['xdpyinfo', '-display', ':99'], + ['Xvfb', ':99', '-screen', '0', '1280x800x24', '-ac', '-dpi', '96'], + ]) + env = port.setup_environ_for_server() + self.assertEqual(env['DISPLAY'], ':99') + + def test_setup_test_runs_finds_free_display(self): + port = self.make_port() + port.host.executive = MockExecutive( + run_command_fn=lambda args: 1 if ':102' in args else 0) + port.setup_test_run() + self.assertEqual( + port.host.executive.calls, + [ + ['xdpyinfo', '-display', ':99'], + ['xdpyinfo', '-display', ':100'], + ['xdpyinfo', '-display', ':101'], + ['xdpyinfo', '-display', ':102'], + ['Xvfb', ':102', '-screen', '0', '1280x800x24', '-ac', '-dpi', '96'], + ]) + env = port.setup_environ_for_server() + self.assertEqual(env['DISPLAY'], ':102')
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py index 4b74117..c4f7445 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py
@@ -442,18 +442,21 @@ help="Ignore locally added files in the working directory (requires git).") parser.add_argument("--css-mode", action="store_true", help="Run CSS testsuite specific lints") + parser.add_argument("--whitelist-path", default=None, + help="Optional path for lint.whitelist") return parser.parse_args() def main(force_css_mode=False): args = parse_args() paths = args.paths if args.paths else all_paths(repo_root, args.ignore_local) - return lint(repo_root, paths, args.json, force_css_mode or args.css_mode) + whitelist_path = kwargs.get("whitelist_path") + return lint(repo_root, paths, output_format, kwargs.get("css_mode", False), whitelist_path) -def lint(repo_root, paths, output_json, css_mode): +def lint(repo_root, paths, output_json, css_mode, whitelist_path=None): error_count = defaultdict(int) last = None - with open(os.path.join(repo_root, "lint.whitelist")) as f: + with open(whitelist_path or os.path.join(repo_root, "lint.whitelist")) as f: whitelist, ignored_files = parse_whitelist(f) if output_json:
diff --git a/third_party/closure_compiler/externs/compiled_resources2.gyp b/third_party/closure_compiler/externs/compiled_resources2.gyp index 7aab119..8e7c817 100644 --- a/third_party/closure_compiler/externs/compiled_resources2.gyp +++ b/third_party/closure_compiler/externs/compiled_resources2.gyp
@@ -109,4 +109,4 @@ 'includes': ['../include_js.gypi'], }, ], -} \ No newline at end of file +}
diff --git a/third_party/closure_compiler/interfaces/compiled_resources2.gyp b/third_party/closure_compiler/interfaces/compiled_resources2.gyp index 34142e9..2c985b7 100644 --- a/third_party/closure_compiler/interfaces/compiled_resources2.gyp +++ b/third_party/closure_compiler/interfaces/compiled_resources2.gyp
@@ -1,4 +1,4 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. +# Copyright 2017 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.
diff --git a/third_party/closure_compiler/tools/create_include_gyp.py b/third_party/closure_compiler/tools/create_include_gyp.py index 08ef525..2febeb3 100755 --- a/third_party/closure_compiler/tools/create_include_gyp.py +++ b/third_party/closure_compiler/tools/create_include_gyp.py
@@ -14,6 +14,9 @@ import sys +_INCLUDE_GYPI = os.path.join(os.path.dirname(__file__), '..', 'include_js.gypi') + + _INCLUDE_TEMPLATE = """ # Copyright %d The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -33,15 +36,15 @@ _TARGET_TEMPLATE = """ { 'target_name': '%s', - 'includes': ['../include_js.gypi'], + 'includes': ['%s'], }""" def CreateIncludeGyp(directory): - include_dir = os.path.join(os.path.dirname(__file__), "..", directory) - include_files = [f for f in os.listdir(include_dir) if f.endswith('.js')] - include_files.sort() - targets = [_TARGET_TEMPLATE % f[:-3] for f in include_files] + include_path = os.path.normpath(os.path.relpath(_INCLUDE_GYPI, directory)) + js_files = [f for f in os.listdir(directory) if f.endswith('.js')] + js_files.sort() + targets = [_TARGET_TEMPLATE % (f[:-3], include_path) for f in js_files] return _INCLUDE_TEMPLATE % (date.today().year, ",".join(targets).strip())
diff --git a/third_party/crashpad/README.chromium b/third_party/crashpad/README.chromium index dc71b92..087a8e4e 100644 --- a/third_party/crashpad/README.chromium +++ b/third_party/crashpad/README.chromium
@@ -2,7 +2,7 @@ Short Name: crashpad URL: https://crashpad.chromium.org/ Version: unknown -Revision: 1f28a123a4c9449e3d7ddad4ff00dacd366d5216 +Revision: b8aaa22905308cc400f880006a84dddac834bd6b License: Apache 2.0 License File: crashpad/LICENSE Security Critical: yes
diff --git a/third_party/crashpad/crashpad/DEPS b/third_party/crashpad/crashpad/DEPS index aefedbc9..5c35e6d6 100644 --- a/third_party/crashpad/crashpad/DEPS +++ b/third_party/crashpad/crashpad/DEPS
@@ -38,7 +38,7 @@ 'crashpad/third_party/mini_chromium/mini_chromium': Var('chromium_git') + '/chromium/mini_chromium@' + - '62e6015f633dd4acb1610db15a064889315cadaa', + 'dc3d480305b27a5a1fb57f51a997529e00fed00b', 'crashpad/third_party/zlib/zlib': Var('chromium_git') + '/chromium/src/third_party/zlib@' + '13dc246a58e4b72104d35f9b1809af95221ebda7',
diff --git a/third_party/crashpad/crashpad/client/crash_report_database.h b/third_party/crashpad/crashpad/client/crash_report_database.h index 3768cb23..6211789 100644 --- a/third_party/crashpad/crashpad/client/crash_report_database.h +++ b/third_party/crashpad/crashpad/client/crash_report_database.h
@@ -144,6 +144,11 @@ kNoError = 0, //! \brief The report that was requested could not be located. + //! + //! This may occur when the report is present in the database but not in a + //! state appropriate for the requested operation, for example, if + //! GetReportForUploading() is called to obtain report that’s already in the + //! completed state. kReportNotFound, //! \brief An error occured while performing a file operation on a crash
diff --git a/third_party/crashpad/crashpad/client/crash_report_database_mac.mm b/third_party/crashpad/crashpad/client/crash_report_database_mac.mm index 0d074cb..3cc2d7fe 100644 --- a/third_party/crashpad/crashpad/client/crash_report_database_mac.mm +++ b/third_party/crashpad/crashpad/client/crash_report_database_mac.mm
@@ -17,6 +17,7 @@ #include <errno.h> #include <fcntl.h> #import <Foundation/Foundation.h> +#include <stdint.h> #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> @@ -146,6 +147,17 @@ OperationStatus RequestUpload(const UUID& uuid) override; private: + //! \brief Report states for use with LocateCrashReport(). + //! + //! ReportState may be considered to be a bitfield. + enum ReportState : uint8_t { + kReportStateWrite = 1 << 0, // in kWriteDirectory + kReportStatePending = 1 << 1, // in kUploadPendingDirectory + kReportStateCompleted = 1 << 2, // in kCompletedDirectory + kReportStateAny = + kReportStateWrite | kReportStatePending | kReportStateCompleted, + }; + //! \brief A private extension of the Report class that maintains bookkeeping //! information of the database. struct UploadReport : public Report { @@ -157,10 +169,12 @@ //! \brief Locates a crash report in the database by UUID. //! //! \param[in] uuid The UUID of the crash report to locate. + //! \param[in] desired_state The state of the report to locate, composed of + //! ReportState values. //! //! \return The full path to the report file, or an empty path if it cannot be //! found. - base::FilePath LocateCrashReport(const UUID& uuid); + base::FilePath LocateCrashReport(const UUID& uuid, uint8_t desired_state); //! \brief Obtains an exclusive advisory lock on a file. //! @@ -392,7 +406,7 @@ CrashReportDatabase::Report* report) { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - base::FilePath path = LocateCrashReport(uuid); + base::FilePath path = LocateCrashReport(uuid, kReportStateAny); if (path.empty()) return kReportNotFound; @@ -429,7 +443,7 @@ const Report** report) { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - base::FilePath report_path = LocateCrashReport(uuid); + base::FilePath report_path = LocateCrashReport(uuid, kReportStatePending); if (report_path.empty()) return kReportNotFound; @@ -459,7 +473,8 @@ DCHECK(report); DCHECK(successful || id.empty()); - base::FilePath report_path = LocateCrashReport(report->uuid); + base::FilePath report_path = + LocateCrashReport(report->uuid, kReportStatePending); if (report_path.empty()) return kReportNotFound; @@ -513,7 +528,7 @@ Metrics::CrashUploadSkipped(reason); - base::FilePath report_path = LocateCrashReport(uuid); + base::FilePath report_path = LocateCrashReport(uuid, kReportStatePending); if (report_path.empty()) return kReportNotFound; @@ -528,7 +543,7 @@ const UUID& uuid) { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - base::FilePath report_path = LocateCrashReport(uuid); + base::FilePath report_path = LocateCrashReport(uuid, kReportStateAny); if (report_path.empty()) return kReportNotFound; @@ -544,11 +559,25 @@ return kNoError; } -base::FilePath CrashReportDatabaseMac::LocateCrashReport(const UUID& uuid) { +base::FilePath CrashReportDatabaseMac::LocateCrashReport( + const UUID& uuid, + uint8_t desired_state) { const std::string target_uuid = uuid.ToString(); - for (size_t i = 0; i < arraysize(kReportDirectories); ++i) { + + std::vector<std::string> report_directories; + if (desired_state & kReportStateWrite) { + report_directories.push_back(kWriteDirectory); + } + if (desired_state & kReportStatePending) { + report_directories.push_back(kUploadPendingDirectory); + } + if (desired_state & kReportStateCompleted) { + report_directories.push_back(kCompletedDirectory); + } + + for (const std::string& report_directory : report_directories) { base::FilePath path = - base_dir_.Append(kReportDirectories[i]) + base_dir_.Append(report_directory) .Append(target_uuid + "." + kCrashReportFileExtension); // Test if the path exists. @@ -573,7 +602,8 @@ const UUID& uuid) { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - base::FilePath report_path = LocateCrashReport(uuid); + base::FilePath report_path = + LocateCrashReport(uuid, kReportStatePending | kReportStateCompleted); if (report_path.empty()) return kReportNotFound;
diff --git a/third_party/crashpad/crashpad/client/crash_report_database_test.cc b/third_party/crashpad/crashpad/client/crash_report_database_test.cc index 0d05df15..da44ebf 100644 --- a/third_party/crashpad/crashpad/client/crash_report_database_test.cc +++ b/third_party/crashpad/crashpad/client/crash_report_database_test.cc
@@ -478,6 +478,22 @@ CrashReportDatabase::kNoError); } +TEST_F(CrashReportDatabaseTest, UploadAlreadyUploaded) { + CrashReportDatabase::Report report; + CreateCrashReport(&report); + + const CrashReportDatabase::Report* upload_report; + EXPECT_EQ(db()->GetReportForUploading(report.uuid, &upload_report), + CrashReportDatabase::kNoError); + EXPECT_EQ(db()->RecordUploadAttempt(upload_report, true, std::string()), + CrashReportDatabase::kNoError); + + const CrashReportDatabase::Report* upload_report_2 = nullptr; + EXPECT_EQ(db()->GetReportForUploading(report.uuid, &upload_report_2), + CrashReportDatabase::kReportNotFound); + EXPECT_FALSE(upload_report_2); +} + TEST_F(CrashReportDatabaseTest, MoveDatabase) { CrashReportDatabase::NewReport* new_report; EXPECT_EQ(db()->PrepareNewCrashReport(&new_report),
diff --git a/third_party/crashpad/crashpad/client/crash_report_database_win.cc b/third_party/crashpad/crashpad/client/crash_report_database_win.cc index 6629d25d..a97b1cf 100644 --- a/third_party/crashpad/crashpad/client/crash_report_database_win.cc +++ b/third_party/crashpad/crashpad/client/crash_report_database_win.cc
@@ -242,8 +242,9 @@ //! written to disk via Write(). //! //! \return #kNoError on success. #kReportNotFound if there was no report with - //! the specified UUID. #kBusyError if the report was not in the specified - //! state. + //! the specified UUID, or if the report was not in the specified state + //! and was not uploading. #kBusyError if the report was not in the + //! specified state and was uploading. OperationStatus FindSingleReportAndMarkDirty(const UUID& uuid, ReportState desired_state, ReportDisk** report_disk); @@ -530,9 +531,13 @@ // static OperationStatus Metadata::VerifyReport(const ReportDisk& report_disk, ReportState desired_state) { - return (report_disk.state == desired_state) - ? VerifyReportAnyState(report_disk) - : CrashReportDatabase::kBusyError; + if (report_disk.state == desired_state) { + return VerifyReportAnyState(report_disk); + } + + return report_disk.state == ReportState::kUploading + ? CrashReportDatabase::kBusyError + : CrashReportDatabase::kReportNotFound; } bool EnsureDirectory(const base::FilePath& path) { @@ -876,7 +881,7 @@ // TODO(gayane): Search for the report only once regardless of its state. OperationStatus os = metadata->FindSingleReportAndMarkDirty( uuid, ReportState::kCompleted, &report_disk); - if (os == kBusyError) { + if (os == kReportNotFound) { os = metadata->FindSingleReportAndMarkDirty( uuid, ReportState::kPending, &report_disk); }
diff --git a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc index 2c2b69b..d77cdba 100644 --- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
@@ -17,6 +17,7 @@ #include <errno.h> #include <time.h> +#include <algorithm> #include <map> #include <memory> #include <vector> @@ -29,12 +30,15 @@ #include "snapshot/module_snapshot.h" #include "util/file/file_reader.h" #include "util/misc/metrics.h" -#include "util/misc/uuid.h" #include "util/net/http_body.h" #include "util/net/http_multipart_builder.h" #include "util/net/http_transport.h" #include "util/stdlib/map_insert.h" +#if defined(OS_MACOSX) +#include "handler/mac/file_limit_annotation.h" +#endif // OS_MACOSX + namespace crashpad { namespace { @@ -139,15 +143,19 @@ CrashReportUploadThread::CrashReportUploadThread(CrashReportDatabase* database, const std::string& url, + bool watch_pending_reports, bool rate_limit, bool upload_gzip) : url_(url), - // Check for pending reports every 15 minutes, even in the absence of a - // signal from the handler thread. This allows for failed uploads to be - // retried periodically, and for pending reports written by other - // processes to be recognized. - thread_(15 * 60, this), + // When watching for pending reports, check every 15 minutes, even in the + // absence of a signal from the handler thread. This allows for failed + // uploads to be retried periodically, and for pending reports written by + // other processes to be recognized. + thread_(watch_pending_reports ? 15 * 60.0 : WorkerThread::kIndefiniteWait, + this), + known_pending_report_uuids_(), database_(database), + watch_pending_reports_(watch_pending_reports), rate_limit_(rate_limit), upload_gzip_(upload_gzip) { } @@ -156,18 +164,43 @@ } void CrashReportUploadThread::Start() { - thread_.Start(0); + thread_.Start(watch_pending_reports_ ? 0.0 : WorkerThread::kIndefiniteWait); } void CrashReportUploadThread::Stop() { thread_.Stop(); } -void CrashReportUploadThread::ReportPending() { +void CrashReportUploadThread::ReportPending(const UUID& report_uuid) { + known_pending_report_uuids_.PushBack(report_uuid); thread_.DoWorkNow(); } void CrashReportUploadThread::ProcessPendingReports() { + std::vector<UUID> known_report_uuids = known_pending_report_uuids_.Drain(); + for (const UUID& report_uuid : known_report_uuids) { + CrashReportDatabase::Report report; + if (database_->LookUpCrashReport(report_uuid, &report) != + CrashReportDatabase::kNoError) { + continue; + } + + ProcessPendingReport(report); + + // Respect Stop() being called after at least one attempt to process a + // report. + if (!thread_.is_running()) { + return; + } + } + + // Known pending reports are always processed (above). The rest of this + // function is concerned with scanning for pending reports not already known + // to this thread. + if (!watch_pending_reports_) { + return; + } + std::vector<CrashReportDatabase::Report> reports; if (database_->GetPendingReports(&reports) != CrashReportDatabase::kNoError) { // The database is sick. It might be prudent to stop trying to poke it from @@ -178,6 +211,15 @@ } for (const CrashReportDatabase::Report& report : reports) { + if (std::find(known_report_uuids.begin(), + known_report_uuids.end(), + report.uuid) != known_report_uuids.end()) { + // An attempt to process the report already occurred above. The report is + // still pending, so upload must have failed. Don’t retry it immediately, + // it can wait until at least the next pass through this method. + continue; + } + ProcessPendingReport(report); // Respect Stop() being called after at least one attempt to process a @@ -190,6 +232,10 @@ void CrashReportUploadThread::ProcessPendingReport( const CrashReportDatabase::Report& report) { +#if defined(OS_MACOSX) + RecordFileLimitAnnotation(); +#endif // OS_MACOSX + Settings* const settings = database_->GetSettings(); bool uploads_enabled; @@ -252,9 +298,12 @@ break; case CrashReportDatabase::kBusyError: + case CrashReportDatabase::kReportNotFound: + // Someone else may have gotten to it first. If they’re working on it now, + // this will be kBusyError. If they’ve already finished with it, it’ll be + // kReportNotFound. return; - case CrashReportDatabase::kReportNotFound: case CrashReportDatabase::kFileSystemError: case CrashReportDatabase::kDatabaseError: // In these cases, SkipReportUpload() might not work either, but it’s best
diff --git a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h index 14debac..c769efed 100644 --- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h +++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
@@ -20,6 +20,8 @@ #include "base/macros.h" #include "client/crash_report_database.h" +#include "util/misc/uuid.h" +#include "util/stdlib/thread_safe_vector.h" #include "util/thread/worker_thread.h" namespace crashpad { @@ -32,22 +34,28 @@ //! report has been added to the database by calling ReportPending(). //! //! Independently of being triggered by ReportPending(), objects of this class -//! periodically examine the database for pending reports. This allows failed -//! upload attempts for reports left in the pending state to be retried. It also -//! catches reports that are added without a ReportPending() signal being -//! caught. This may happen if crash reports are added to the database by other -//! processes. +//! can periodically examine the database for pending reports. This allows +//! failed upload attempts for reports left in the pending state to be retried. +//! It also catches reports that are added without a ReportPending() signal +//! being caught. This may happen if crash reports are added to the database by +//! other processes. class CrashReportUploadThread : public WorkerThread::Delegate { public: //! \brief Constructs a new object. //! //! \param[in] database The database to upload crash reports from. //! \param[in] url The URL of the server to upload crash reports to. + //! \param[in] watch_pending_reports Whether to periodically check for new + //! pending reports not already known to exist. When `false`, only an + //! initial upload attempt will be made for reports known to exist by + //! having been added by the ReportPending() method. No scans for new + //! pending reports will be conducted. //! \param[in] rate_limit Whether uploads should be throttled to a (currently //! hardcoded) rate. //! \param[in] upload_gzip Whether uploads should use `gzip` compression. CrashReportUploadThread(CrashReportDatabase* database, const std::string& url, + bool watch_pending_reports, bool rate_limit, bool upload_gzip); ~CrashReportUploadThread(); @@ -75,8 +83,11 @@ //! \brief Informs the upload thread that a new pending report has been added //! to the database. //! + //! \param[in] report_uuid The unique identifier of the newly added pending + //! report. + //! //! This method may be called from any thread. - void ReportPending(); + void ReportPending(const UUID& report_uuid); private: //! \brief The result code from UploadReport(). @@ -99,8 +110,13 @@ kRetry, }; - //! \brief Obtains all pending reports from the database, and calls - //! ProcessPendingReport() to process each one. + //! \brief Calls ProcessPendingReport() on pending reports. + //! + //! Assuming Stop() has not been called, this will process reports that the + //! object has been made aware of in ReportPending(). Additionally, if the + //! object was constructed with \a watch_pending_reports, it will also scan + //! the crash report database for other pending reports, and process those as + //! well. void ProcessPendingReports(); //! \brief Processes a single pending report from the database. @@ -137,11 +153,13 @@ //! been called on any thread, as well as periodically on a timer. void DoWork(const WorkerThread* thread) override; - std::string url_; + const std::string url_; WorkerThread thread_; + ThreadSafeVector<UUID> known_pending_report_uuids_; CrashReportDatabase* database_; // weak - bool rate_limit_; - bool upload_gzip_; + const bool watch_pending_reports_; + const bool rate_limit_; + const bool upload_gzip_; DISALLOW_COPY_AND_ASSIGN(CrashReportUploadThread); };
diff --git a/third_party/crashpad/crashpad/handler/crashpad_handler.md b/third_party/crashpad/crashpad/handler/crashpad_handler.md index e76fed7..9cb29e4 100644 --- a/third_party/crashpad/crashpad/handler/crashpad_handler.md +++ b/third_party/crashpad/crashpad/handler/crashpad_handler.md
@@ -151,7 +151,8 @@ become a client of the second one. The second instance will be started with the same **--annotation**, **--database**, **--monitor-self-annotation**, **--no-rate-limit**, **--no-upload-gzip**, and **--url** arguments as the - original one. The second instance will not be started with a + original one. The second instance will always be started with a + **--no-periodic-tasks** argument, and will not be started with a **--metrics-dir** argument even if the original instance was. Where supported by the underlying operating system, the second instance will @@ -183,6 +184,20 @@ To prevent excessive accumulation of handler processes, _ARGUMENT_ must not be `--monitor-self`. + * **--no-periodic-tasks** + + Do not scan for new pending crash reports or prune the crash report database. + Only crash reports recorded by this instance of the Crashpad handler will + become eligible for upload in this instance, and only a single initial upload + attempt will be made. + + This option is not intended for general use. It is provided to prevent + multiple instances of the Crashpad handler from duplicating the effort of + performing the same periodic tasks. In normal use, the first instance of the + Crashpad handler will assume the responsibility for performing these tasks, + and will provide this argument to any second instance. See + **--monitor-self**. + * **--no-rate-limit** Do not rate limit the upload of crash reports. By default uploads are
diff --git a/third_party/crashpad/crashpad/handler/handler.gyp b/third_party/crashpad/crashpad/handler/handler.gyp index d6e4c27..50479828 100644 --- a/third_party/crashpad/crashpad/handler/handler.gyp +++ b/third_party/crashpad/crashpad/handler/handler.gyp
@@ -43,6 +43,8 @@ 'mac/crash_report_exception_handler.h', 'mac/exception_handler_server.cc', 'mac/exception_handler_server.h', + 'mac/file_limit_annotation.cc', + 'mac/file_limit_annotation.h', 'prune_crash_reports_thread.cc', 'prune_crash_reports_thread.h', 'user_stream_data_source.cc',
diff --git a/third_party/crashpad/crashpad/handler/handler_main.cc b/third_party/crashpad/crashpad/handler/handler_main.cc index 641bf0f6..e6d05e2 100644 --- a/third_party/crashpad/crashpad/handler/handler_main.cc +++ b/third_party/crashpad/crashpad/handler/handler_main.cc
@@ -61,6 +61,7 @@ #include "base/mac/scoped_mach_port.h" #include "handler/mac/crash_report_exception_handler.h" #include "handler/mac/exception_handler_server.h" +#include "handler/mac/file_limit_annotation.h" #include "util/mach/child_port_handshake.h" #include "util/mach/mach_extensions.h" #include "util/posix/close_stdio.h" @@ -109,6 +110,7 @@ " set a module annotation in the handler\n" " --monitor-self-argument=ARGUMENT\n" " provide additional arguments to the second handler\n" +" --no-periodic-tasks don't scan for new reports or prune the database\n" " --no-rate-limit don't rate limit crash uploads\n" " --no-upload-gzip don't use gzip compression when uploading\n" #if defined(OS_WIN) @@ -142,6 +144,7 @@ InitialClientData initial_client_data; #endif // OS_MACOSX bool monitor_self; + bool periodic_tasks; bool rate_limit; bool upload_gzip; }; @@ -353,6 +356,7 @@ return; } std::vector<std::string> extra_arguments(options.monitor_self_arguments); + extra_arguments.push_back("--no-periodic-tasks"); if (!options.rate_limit) { extra_arguments.push_back("--no-rate-limit"); } @@ -416,6 +420,7 @@ kOptionMonitorSelf, kOptionMonitorSelfAnnotation, kOptionMonitorSelfArgument, + kOptionNoPeriodicTasks, kOptionNoRateLimit, kOptionNoUploadGzip, #if defined(OS_WIN) @@ -456,6 +461,7 @@ required_argument, nullptr, kOptionMonitorSelfArgument}, + {"no-periodic-tasks", no_argument, nullptr, kOptionNoPeriodicTasks}, {"no-rate-limit", no_argument, nullptr, kOptionNoRateLimit}, {"no-upload-gzip", no_argument, nullptr, kOptionNoUploadGzip}, #if defined(OS_WIN) @@ -477,6 +483,7 @@ #if defined(OS_MACOSX) options.handshake_fd = -1; #endif + options.periodic_tasks = true; options.rate_limit = true; options.upload_gzip = true; @@ -540,6 +547,10 @@ options.monitor_self_arguments.push_back(optarg); break; } + case kOptionNoPeriodicTasks: { + options.periodic_tasks = false; + break; + } case kOptionNoRateLimit: { options.rate_limit = false; break; @@ -687,6 +698,8 @@ reset_sigterm.reset(&old_sigterm_action); } } + + RecordFileLimitAnnotation(); #elif defined(OS_WIN) // Shut down as late as possible relative to programs we're watching. if (!SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY)) @@ -721,13 +734,19 @@ // TODO(scottmg): options.rate_limit should be removed when we have a // configurable database setting to control upload limiting. // See https://crashpad.chromium.org/bug/23. - CrashReportUploadThread upload_thread( - database.get(), options.url, options.rate_limit, options.upload_gzip); + CrashReportUploadThread upload_thread(database.get(), + options.url, + options.periodic_tasks, + options.rate_limit, + options.upload_gzip); upload_thread.Start(); - PruneCrashReportThread prune_thread(database.get(), - PruneCondition::GetDefault()); - prune_thread.Start(); + std::unique_ptr<PruneCrashReportThread> prune_thread; + if (options.periodic_tasks) { + prune_thread.reset(new PruneCrashReportThread( + database.get(), PruneCondition::GetDefault())); + prune_thread->Start(); + } CrashReportExceptionHandler exception_handler(database.get(), &upload_thread, @@ -744,7 +763,9 @@ exception_handler_server.Run(&exception_handler); upload_thread.Stop(); - prune_thread.Stop(); + if (prune_thread) { + prune_thread->Stop(); + } return EXIT_SUCCESS; }
diff --git a/third_party/crashpad/crashpad/handler/handler_main.h b/third_party/crashpad/crashpad/handler/handler_main.h index 1e78aa5..af01dbe 100644 --- a/third_party/crashpad/crashpad/handler/handler_main.h +++ b/third_party/crashpad/crashpad/handler/handler_main.h
@@ -24,6 +24,8 @@ //! This is exposed so that `crashpad_handler` can be embedded into another //! binary, but called and used as if it were a standalone executable. //! +//! \param[in] argc \a argc as passed to `main()`. +//! \param[in] argv \a argv as passed to `main()`. //! \param[in] user_stream_sources An optional vector containing the //! extensibility data sources to call on crash. Each time a minidump is //! created, the sources are called in turn. Any streams returned are added
diff --git a/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.cc b/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.cc index a96131c..6f9cdbe 100644 --- a/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.cc +++ b/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.cc
@@ -21,6 +21,7 @@ #include "base/mac/scoped_mach_port.h" #include "base/strings/stringprintf.h" #include "client/settings.h" +#include "handler/mac/file_limit_annotation.h" #include "minidump/minidump_file_writer.h" #include "minidump/minidump_user_extension_stream_data_source.h" #include "snapshot/crashpad_info_client_options.h" @@ -67,6 +68,7 @@ mach_msg_type_number_t* new_state_count, const mach_msg_trailer_t* trailer, bool* destroy_complex_request) { + RecordFileLimitAnnotation(); Metrics::ExceptionEncountered(); Metrics::ExceptionCode(ExceptionCodeForMetrics(exception, code[0])); *destroy_complex_request = true; @@ -190,7 +192,7 @@ return KERN_FAILURE; } - upload_thread_->ReportPending(); + upload_thread_->ReportPending(uuid); } if (client_options.system_crash_reporter_forwarding != TriState::kDisabled &&
diff --git a/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.h b/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.h index b878cfe4..cc314f1 100644 --- a/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.h +++ b/third_party/crashpad/crashpad/handler/mac/crash_report_exception_handler.h
@@ -47,6 +47,10 @@ //! To interoperate with Breakpad servers, the recommended practice is to //! specify values for the `"prod"` and `"ver"` keys as process //! annotations. + //! \param[in] user_stream_data_sources Data sources to be used to extend + //! crash reports. For each crash report that is written, the data sources + //! are called in turn. These data sources may contribute additional + //! minidump streams. `nullptr` if not required. CrashReportExceptionHandler( CrashReportDatabase* database, CrashReportUploadThread* upload_thread,
diff --git a/third_party/crashpad/crashpad/handler/mac/exception_handler_server.cc b/third_party/crashpad/crashpad/handler/mac/exception_handler_server.cc index 38a016e..3f30e03 100644 --- a/third_party/crashpad/crashpad/handler/mac/exception_handler_server.cc +++ b/third_party/crashpad/crashpad/handler/mac/exception_handler_server.cc
@@ -105,7 +105,14 @@ MachMessageServer::kOneShot, MachMessageServer::kReceiveLargeIgnore, kMachMessageTimeoutWaitIndefinitely); - MACH_CHECK(mr == MACH_MSG_SUCCESS, mr) << "MachMessageServer::Run"; + + // MACH_SEND_INVALID_DEST occurs when attempting to reply to a dead name. + // This can happen if a mach_exc or exc client disappears before a reply + // can be sent to it. That’s unusal for kernel-generated requests, but can + // easily happen if a task sends its own exception request (as + // SimulateCrash() does) and dies before the reply is sent. + MACH_CHECK(mr == MACH_MSG_SUCCESS || mr == MACH_SEND_INVALID_DEST, mr) + << "MachMessageServer::Run"; } }
diff --git a/third_party/crashpad/crashpad/handler/mac/file_limit_annotation.cc b/third_party/crashpad/crashpad/handler/mac/file_limit_annotation.cc new file mode 100644 index 0000000..359ed8e --- /dev/null +++ b/third_party/crashpad/crashpad/handler/mac/file_limit_annotation.cc
@@ -0,0 +1,93 @@ +// Copyright 2017 The Crashpad Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "handler/mac/file_limit_annotation.h" + +#include <errno.h> +#include <sys/resource.h> +#include <sys/sysctl.h> +#include <sys/types.h> + +#include <string> + +#include "base/format_macros.h" +#include "base/macros.h" +#include "base/strings/stringprintf.h" +#include "client/crashpad_info.h" +#include "client/simple_string_dictionary.h" + +namespace { + +// rv is the return value from sysctl() or sysctlbyname(), and value and size +// are the pointers passed as oldp and oldlenp. If sysctl() failed, the returned +// string will be "E" followed by the error number. If there was a size +// mismatch, the returned string will be "Z" followed by the size indicated by +// sysctl(). Normally, a string representation of *value will be returned. +std::string FormatFromSysctl(int rv, const int* value, const size_t* size) { + if (rv != 0) { + return base::StringPrintf("E%d", errno); + } + if (*size != sizeof(*value)) { + return base::StringPrintf("Z%zu", *size); + } + return base::StringPrintf("%d", *value); +} + +// Returns a string for |limit|, or "inf" if |limit| is RLIM_INFINITY. +std::string StringForRLim(rlim_t limit) { + if (limit == RLIM_INFINITY) { + return std::string("inf"); + } + + return base::StringPrintf("%" PRIu64, limit); +} + +} // namespace + +namespace crashpad { + +void RecordFileLimitAnnotation() { + CrashpadInfo* crashpad_info = CrashpadInfo::GetCrashpadInfo(); + SimpleStringDictionary* simple_annotations = + crashpad_info->simple_annotations(); + if (!simple_annotations) { + simple_annotations = new SimpleStringDictionary(); + crashpad_info->set_simple_annotations(simple_annotations); + } + + int value; + size_t size = sizeof(value); + std::string num_files = FormatFromSysctl( + sysctlbyname("kern.num_files", &value, &size, nullptr, 0), &value, &size); + + int mib[] = {CTL_KERN, KERN_MAXFILES}; + size = sizeof(value); + std::string max_files = FormatFromSysctl( + sysctl(mib, arraysize(mib), &value, &size, nullptr, 0), &value, &size); + + rlimit limit; + std::string nofile; + if (getrlimit(RLIMIT_NOFILE, &limit) != 0) { + nofile = base::StringPrintf("E%d,E%d", errno, errno); + } else { + nofile = + StringForRLim(limit.rlim_cur) + "," + StringForRLim(limit.rlim_max); + } + + std::string annotation = base::StringPrintf( + "%s,%s,%s", num_files.c_str(), max_files.c_str(), nofile.c_str()); + simple_annotations->SetKeyValue("file-limits", annotation.c_str()); +} + +} // namespace crashpad
diff --git a/third_party/crashpad/crashpad/handler/mac/file_limit_annotation.h b/third_party/crashpad/crashpad/handler/mac/file_limit_annotation.h new file mode 100644 index 0000000..1131986 --- /dev/null +++ b/third_party/crashpad/crashpad/handler/mac/file_limit_annotation.h
@@ -0,0 +1,38 @@ +// Copyright 2017 The Crashpad Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef CRASHPAD_HANDLER_MAC_FILE_LIMIT_ANNOTATION_H_ +#define CRASHPAD_HANDLER_MAC_FILE_LIMIT_ANNOTATION_H_ + +namespace crashpad { + +//! \brief Records a `"file-limits"` simple annotation for the process. +//! +//! This annotation will be used to confirm the theory that certain crashes are +//! caused by systems at or near their file descriptor table size limits. +//! +//! The format of the annotation is four comma-separated values: the system-wide +//! `kern.num_files` and `kern.maxfiles` values from `sysctl()`, and the +//! process-specific current and maximum file descriptor limits from +//! `getrlimit(RLIMIT_NOFILE, …)`. +//! +//! See https://crashpad.chromium.org/bug/180. +//! +//! TODO(mark): Remove this annotation after sufficient data has been collected +//! for analysis. +void RecordFileLimitAnnotation(); + +} // namespace crashpad + +#endif // CRASHPAD_HANDLER_MAC_FILE_LIMIT_ANNOTATION_H_
diff --git a/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc b/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc index 7828aac6..0ab206c1 100644 --- a/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc +++ b/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc
@@ -130,7 +130,7 @@ return termination_code; } - upload_thread_->ReportPending(); + upload_thread_->ReportPending(uuid); } Metrics::ExceptionCaptureResult(Metrics::CaptureResult::kSuccess);
diff --git a/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.h b/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.h index 521ccd3..54dfa9719 100644 --- a/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.h +++ b/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.h
@@ -48,6 +48,10 @@ //! To interoperate with Breakpad servers, the recommended practice is to //! specify values for the `"prod"` and `"ver"` keys as process //! annotations. + //! \param[in] user_stream_data_sources Data sources to be used to extend + //! crash reports. For each crash report that is written, the data sources + //! are called in turn. These data sources may contribute additional + //! minidump streams. `nullptr` if not required. CrashReportExceptionHandler( CrashReportDatabase* database, CrashReportUploadThread* upload_thread,
diff --git a/third_party/crashpad/crashpad/util/mach/mach_message_server.h b/third_party/crashpad/crashpad/util/mach/mach_message_server.h index 9793560..5e96c4ce 100644 --- a/third_party/crashpad/crashpad/util/mach/mach_message_server.h +++ b/third_party/crashpad/crashpad/util/mach/mach_message_server.h
@@ -162,7 +162,11 @@ //! timeout_ms is not #kMachMessageTimeoutWaitIndefinitely). This function //! has no successful return value when \a persistent is #kPersistent and //! \a timeout_ms is #kMachMessageTimeoutWaitIndefinitely. On failure, - //! returns a value identifying the nature of the error. + //! returns a value identifying the nature of the error. A request + //! received with a reply port that is (or becomes) a dead name before the + //! reply is sent will result in `MACH_SEND_INVALID_DEST` as a return + //! value, which may or may not be considered an error from the caller’s + //! perspective. static mach_msg_return_t Run(Interface* interface, mach_port_t receive_port, mach_msg_options_t options,
diff --git a/third_party/crashpad/crashpad/util/posix/process_info_linux.cc b/third_party/crashpad/crashpad/util/posix/process_info_linux.cc index 13b15a0..60b7b7f 100644 --- a/third_party/crashpad/crashpad/util/posix/process_info_linux.cc +++ b/third_party/crashpad/crashpad/util/posix/process_info_linux.cc
@@ -209,12 +209,15 @@ LOG(ERROR) << "format error: multiple Groups lines"; return false; } - gid_t group; - while (AdvancePastNumber(&line_c, &group)) { - supplementary_groups_.insert(group); - if (!AdvancePastPrefix(&line_c, " ")) { - LOG(ERROR) << "format error: unrecognized Groups format"; - return false; + if (!AdvancePastPrefix(&line_c, " ")) { + // In Linux 4.10, even an empty Groups: line has a trailing space. + gid_t group; + while (AdvancePastNumber(&line_c, &group)) { + supplementary_groups_.insert(group); + if (!AdvancePastPrefix(&line_c, " ")) { + LOG(ERROR) << "format error: unrecognized Groups format"; + return false; + } } } have_groups = true;
diff --git a/third_party/crashpad/crashpad/util/stdlib/thread_safe_vector.h b/third_party/crashpad/crashpad/util/stdlib/thread_safe_vector.h new file mode 100644 index 0000000..f97024d0 --- /dev/null +++ b/third_party/crashpad/crashpad/util/stdlib/thread_safe_vector.h
@@ -0,0 +1,63 @@ +// Copyright 2017 The Crashpad Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef CRASHPAD_UTIL_STDLIB_THREAD_SAFE_VECTOR_H_ +#define CRASHPAD_UTIL_STDLIB_THREAD_SAFE_VECTOR_H_ + +#include <utility> +#include <vector> + +#include "base/macros.h" +#include "base/synchronization/lock.h" + +namespace crashpad { + +//! \brief A wrapper for a `std::vector<>` that can be accessed safely from +//! multiple threads. +//! +//! This is not a drop-in replacement for `std::vector<>`. Only necessary +//! operations are defined. +template <typename T> +class ThreadSafeVector { + public: + ThreadSafeVector() : vector_(), lock_() {} + ~ThreadSafeVector() {} + + //! \brief Wraps `std::vector<>::%push_back()`. + void PushBack(const T& element) { + base::AutoLock lock_owner(lock_); + vector_.push_back(element); + } + + //! \brief Atomically clears the underlying vector and returns its previous + //! contents. + std::vector<T> Drain() { + std::vector<T> contents; + { + base::AutoLock lock_owner(lock_); + std::swap(vector_, contents); + } + return contents; + } + + private: + std::vector<T> vector_; + base::Lock lock_; + + DISALLOW_COPY_AND_ASSIGN(ThreadSafeVector); +}; + +} // namespace crashpad + +#endif // CRASHPAD_UTIL_STDLIB_THREAD_SAFE_VECTOR_H_
diff --git a/third_party/crashpad/crashpad/util/stdlib/thread_safe_vector_test.cc b/third_party/crashpad/crashpad/util/stdlib/thread_safe_vector_test.cc new file mode 100644 index 0000000..805360f4 --- /dev/null +++ b/third_party/crashpad/crashpad/util/stdlib/thread_safe_vector_test.cc
@@ -0,0 +1,91 @@ +// Copyright 2017 The Crashpad Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "util/stdlib/thread_safe_vector.h" + +#include "gtest/gtest.h" +#include "util/thread/thread.h" + +namespace crashpad { +namespace test { +namespace { + +constexpr int kElementsPerThread = 100; + +class ThreadSafeVectorTestThread : public Thread { + public: + ThreadSafeVectorTestThread() : thread_safe_vector_(nullptr), start_(0) {} + ~ThreadSafeVectorTestThread() {} + + void SetTestParameters(ThreadSafeVector<int>* thread_safe_vector, int start) { + thread_safe_vector_ = thread_safe_vector; + start_ = start; + } + + // Thread: + void ThreadMain() override { + for (int i = start_; i < start_ + kElementsPerThread; ++i) { + thread_safe_vector_->PushBack(i); + } + } + + private: + ThreadSafeVector<int>* thread_safe_vector_; + int start_; + + DISALLOW_COPY_AND_ASSIGN(ThreadSafeVectorTestThread); +}; + +TEST(ThreadSafeVector, ThreadSafeVector) { + ThreadSafeVector<int> thread_safe_vector; + std::vector<int> vector = thread_safe_vector.Drain(); + EXPECT_TRUE(vector.empty()); + + ThreadSafeVectorTestThread threads[100]; + for (size_t index = 0; index < arraysize(threads); ++index) { + threads[index].SetTestParameters( + &thread_safe_vector, static_cast<int>(index * kElementsPerThread)); + } + + for (size_t index = 0; index < arraysize(threads); ++index) { + threads[index].Start(); + + if (index % 10 == 0) { + // Drain the vector periodically to test that simultaneous Drain() and + // PushBack() operations work properly. + std::vector<int> drained = thread_safe_vector.Drain(); + vector.insert(vector.end(), drained.begin(), drained.end()); + } + } + + for (ThreadSafeVectorTestThread& thread : threads) { + thread.Join(); + } + + std::vector<int> drained = thread_safe_vector.Drain(); + vector.insert(vector.end(), drained.begin(), drained.end()); + bool found[arraysize(threads) * kElementsPerThread] = {}; + EXPECT_EQ(vector.size(), arraysize(found)); + for (int element : vector) { + EXPECT_FALSE(found[element]) << element; + found[element] = true; + } + + vector = thread_safe_vector.Drain(); + EXPECT_TRUE(vector.empty()); +} + +} // namespace +} // namespace test +} // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore.h b/third_party/crashpad/crashpad/util/synchronization/semaphore.h index ac77cb7c..49479639 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore.h +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore.h
@@ -15,6 +15,8 @@ #ifndef CRASHPAD_UTIL_SYNCHRONIZATION_SEMAPHORE_H_ #define CRASHPAD_UTIL_SYNCHRONIZATION_SEMAPHORE_H_ +#include <limits> + #include "build/build_config.h" #if defined(OS_MACOSX) @@ -30,6 +32,10 @@ //! \brief An anonymous in-process counting sempahore. class Semaphore { public: + //! \brief A TimedWait() argument that causes an indefinite wait. + static constexpr double kIndefiniteWait = + std::numeric_limits<double>::infinity(); + //! \brief Initializes the semaphore. //! //! \param[in] value The initial value of the semaphore. @@ -51,7 +57,8 @@ //! \brief Performs a timed wait (or “procure”) operation on the semaphore. //! //! \param[in] seconds The maximum number of seconds to wait for the operation - //! to complete. + //! to complete. If \a seconds is #kIndefiniteWait, this method behaves as + //! Wait(), and will not time out. //! //! \return `false` if the wait timed out, `true` otherwise. //!
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc index e8a79ab..4f3bf00 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc
@@ -14,6 +14,8 @@ #include "util/synchronization/semaphore.h" +#include <cmath> + #include "base/logging.h" namespace crashpad { @@ -33,6 +35,12 @@ bool Semaphore::TimedWait(double seconds) { DCHECK_GE(seconds, 0.0); + + if (std::isinf(seconds)) { + Wait(); + return true; + } + const dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC); return dispatch_semaphore_wait(semaphore_, timeout) == 0;
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc index 973f0a5d..c781e4c6 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc
@@ -39,6 +39,12 @@ bool Semaphore::TimedWait(double seconds) { DCHECK_GE(seconds, 0.0); + + if (std::isinf(seconds)) { + Wait(); + return true; + } + timespec timeout; timeout.tv_sec = seconds; timeout.tv_nsec = (seconds - trunc(seconds)) * 1E9;
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc index fb4338c0..ccaf742 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc
@@ -43,6 +43,18 @@ EXPECT_FALSE(semaphore.TimedWait(0.01)); // 10ms } +TEST(Semaphore, TimedWaitInfinite_0) { + Semaphore semaphore(0); + semaphore.Signal(); + EXPECT_TRUE(semaphore.TimedWait(std::numeric_limits<double>::infinity())); +} + +TEST(Semaphore, TimedWaitInfinite_1) { + Semaphore semaphore(1); + EXPECT_TRUE(semaphore.TimedWait(std::numeric_limits<double>::infinity())); + semaphore.Signal(); +} + struct ThreadMainInfo { #if defined(OS_POSIX) pthread_t pthread;
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc index 962c7ba..2f26c23 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc
@@ -14,6 +14,7 @@ #include "util/synchronization/semaphore.h" +#include <cmath> #include <limits> #include "base/logging.h" @@ -38,6 +39,12 @@ bool Semaphore::TimedWait(double seconds) { DCHECK_GE(seconds, 0.0); + + if (std::isinf(seconds)) { + Wait(); + return true; + } + DWORD rv = WaitForSingleObject(semaphore_, static_cast<DWORD>(seconds * 1E3)); PCHECK(rv == WAIT_OBJECT_0 || rv == WAIT_TIMEOUT) << "WaitForSingleObject"; return rv == WAIT_OBJECT_0;
diff --git a/third_party/crashpad/crashpad/util/thread/worker_thread.cc b/third_party/crashpad/crashpad/util/thread/worker_thread.cc index 595ef8f..3cf4897 100644 --- a/third_party/crashpad/crashpad/util/thread/worker_thread.cc +++ b/third_party/crashpad/crashpad/util/thread/worker_thread.cc
@@ -15,7 +15,6 @@ #include "util/thread/worker_thread.h" #include "base/logging.h" -#include "util/synchronization/semaphore.h" #include "util/thread/thread.h" namespace crashpad {
diff --git a/third_party/crashpad/crashpad/util/thread/worker_thread.h b/third_party/crashpad/crashpad/util/thread/worker_thread.h index 321d9184..97fb6ec 100644 --- a/third_party/crashpad/crashpad/util/thread/worker_thread.h +++ b/third_party/crashpad/crashpad/util/thread/worker_thread.h
@@ -18,6 +18,7 @@ #include <memory> #include "base/macros.h" +#include "util/synchronization/semaphore.h" namespace crashpad { @@ -40,11 +41,16 @@ virtual ~Delegate() {} }; + //! \brief A delay or interval argument that causes an indefinite wait. + static constexpr double kIndefiniteWait = Semaphore::kIndefiniteWait; + //! \brief Creates a new WorkerThread that is not yet running. //! //! \param[in] work_interval The time interval in seconds at which the \a //! delegate runs. The interval counts from the completion of - //! Delegate::DoWork() to the next invocation. + //! Delegate::DoWork() to the next invocation. This can be + //! #kIndefiniteWait if work should only be done when DoWorkNow() is + //! called. //! \param[in] delegate The work delegate to invoke every interval. WorkerThread(double work_interval, Delegate* delegate); ~WorkerThread(); @@ -55,7 +61,8 @@ //! //! \param[in] initial_work_delay The amount of time in seconds to wait //! before invoking the \a delegate for the first time. Pass `0` for - //! no delay. + //! no delay. This can be #kIndefiniteWait if work should not be done + //! until DoWorkNow() is called. void Start(double initial_work_delay); //! \brief Stops the worker thread from running.
diff --git a/third_party/crashpad/crashpad/util/util.gyp b/third_party/crashpad/crashpad/util/util.gyp index 7ef7a0c..5bc4de6 100644 --- a/third_party/crashpad/crashpad/util/util.gyp +++ b/third_party/crashpad/crashpad/util/util.gyp
@@ -168,6 +168,7 @@ 'stdlib/strlcpy.h', 'stdlib/strnlen.cc', 'stdlib/strnlen.h', + 'stdlib/thread_safe_vector.h', 'string/split_string.cc', 'string/split_string.h', 'synchronization/semaphore_mac.cc',
diff --git a/third_party/crashpad/crashpad/util/util_test.gyp b/third_party/crashpad/crashpad/util/util_test.gyp index 31323c0..95dac08 100644 --- a/third_party/crashpad/crashpad/util/util_test.gyp +++ b/third_party/crashpad/crashpad/util/util_test.gyp
@@ -87,6 +87,7 @@ 'stdlib/string_number_conversion_test.cc', 'stdlib/strlcpy_test.cc', 'stdlib/strnlen_test.cc', + 'stdlib/thread_safe_vector_test.cc', 'string/split_string_test.cc', 'synchronization/semaphore_test.cc', 'thread/thread_log_messages_test.cc',
diff --git a/tools/android/eclipse/.classpath b/tools/android/eclipse/.classpath index 91700431..c124299 100644 --- a/tools/android/eclipse/.classpath +++ b/tools/android/eclipse/.classpath
@@ -26,6 +26,7 @@ <classpathentry kind="src" path="base/android/java/src"/> <classpathentry kind="src" path="base/android/javatests/src"/> <classpathentry kind="src" path="base/test/android/javatests/src"/> + <classpathentry kind="src" path="base/test/android/junit/src"/> <classpathentry kind="src" path="chrome/android/java/src"/> <classpathentry kind="src" path="chrome/android/javatests/src"/> <classpathentry kind="src" path="chrome/android/sync_shell/javatests/src"/>
diff --git a/tools/determinism/deterministic_build_whitelist.pyl b/tools/determinism/deterministic_build_whitelist.pyl index 6dcc789..ef80412 100644 --- a/tools/determinism/deterministic_build_whitelist.pyl +++ b/tools/determinism/deterministic_build_whitelist.pyl
@@ -101,6 +101,7 @@ 'it2me_standalone_host_main', 'jingle_unittests', 'khronos_glcts_test', + 'latency_unittests', 'leveldb_service_unittests', 'libaddressinput_unittests', 'libapp_shell_framework.dylib', @@ -261,6 +262,7 @@ 'jingle_unittests.exe', 'keyboard_unittests.exe', 'khronos_glcts_test.exe', + 'latency_unittests.exe', 'leveldb_service_unittests.exe', 'libaddressinput_unittests.exe', 'login_library.dll',
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 52f9a6b..4f1ec4167 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -83125,6 +83125,8 @@ <enum name="AppLoadedInTabSource" type="int"> <int value="0" label="SOURCE_APP"/> <int value="1" label="SOURCE_BACKGROUND_PAGE"/> + <int value="2" label="SOURCE_OTHER_EXTENSION"/> + <int value="3" label="SOURCE_OTHER"/> </enum> <enum name="AppLocation" type="int"> @@ -88749,6 +88751,7 @@ <int value="19" label="Arrived at settings menu by main menu item: entered on, exited on"/> + <int value="20" label="Data usage stats reset via the settings menu"/> </enum> <enum name="DataUrlMimeType" type="int"> @@ -95742,6 +95745,8 @@ <int value="1961" label="ViewportFixedPositionUnderFilter"/> <int value="1962" label="RequestMIDIAccessWithSysExOption"/> <int value="1963" label="RequestMIDIAccessIframeWithSysExOption"/> + <int value="1964" label="GamepadAxes"/> + <int value="1965" label="GamepadButtons"/> </enum> <enum name="FetchRequestMode" type="int"> @@ -119684,7 +119689,7 @@ <affected-histogram name="PLT.PT_StartToFinish"/> </histogram_suffixes> -<histogram_suffixes name="GeolocationSettingsDialogSource"> +<histogram_suffixes name="GeolocationSettingsDialogSource" separator="."> <suffix name="DSE" label="Default search engine"/> <suffix name="NonDSE" label="Non-default search engine"/> <affected-histogram name="Geolocation.SettingsDialog.AcceptEvent"/>
diff --git a/tools/valgrind/chrome_tests.py b/tools/valgrind/chrome_tests.py index a4e6c4d..9c7143a 100755 --- a/tools/valgrind/chrome_tests.py +++ b/tools/valgrind/chrome_tests.py
@@ -400,6 +400,9 @@ def TestKeyboard(self): return self.SimpleTest("keyboard", "keyboard_unittests") + def TestLatency(self): + return self.SimpleTest("latency", "latency_unittests") + def TestMedia(self): return self.SimpleTest("chrome", "media_unittests") @@ -686,6 +689,7 @@ "interactive_ui": TestInteractiveUI, "jingle": TestJingle, "jingle_unittests": TestJingle, "keyboard": TestKeyboard, "keyboard_unittests": TestKeyboard, + "latency": TestLatency, "latency_unittests": TestLatency, "layout": TestLayout, "layout_tests": TestLayout, "media": TestMedia, "media_unittests": TestMedia, "message_center": TestMessageCenter,
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn index 7fddc3b..65a14c0a 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn
@@ -571,6 +571,8 @@ "cursor/cursor_ozone.cc", "cursor/ozone/bitmap_cursor_factory_ozone.cc", "cursor/ozone/bitmap_cursor_factory_ozone.h", + "cursor/ozone/cursor_data_factory_ozone.cc", + "cursor/ozone/cursor_data_factory_ozone.h", ] deps += [ @@ -806,6 +808,7 @@ set_sources_assignment_filter(sources_assignment_filter) } else { # !is_ios sources += [ + "accelerators/accelerator_history_unittest.cc", "accelerators/accelerator_manager_unittest.cc", "accelerators/accelerator_unittest.cc", "accelerators/menu_label_accelerator_util_linux_unittest.cc",
diff --git a/ui/base/accelerators/accelerator_history.cc b/ui/base/accelerators/accelerator_history.cc index d356e32..94e78da2 100644 --- a/ui/base/accelerators/accelerator_history.cc +++ b/ui/base/accelerators/accelerator_history.cc
@@ -4,24 +4,27 @@ #include "ui/base/accelerators/accelerator_history.h" -#include "ui/events/event_constants.h" - namespace ui { -// ---------------------------------------------------------------------- -// Public Methods -// ---------------------------------------------------------------------- +AcceleratorHistory::AcceleratorHistory() {} -AcceleratorHistory::AcceleratorHistory() - : current_accelerator_(), - previous_accelerator_() { -} - -AcceleratorHistory::~AcceleratorHistory() { -} +AcceleratorHistory::~AcceleratorHistory() {} void AcceleratorHistory::StoreCurrentAccelerator( - const Accelerator& accelerator) { + const Accelerator& accelerator) { + // Track the currently pressed keys so that we don't mistakenly store an + // already pressed key as a new keypress after another key has been released. + // As an example, when the user presses and holds Alt+Search, then releases + // Alt but keeps holding the Search key down, at this point no new Search + // presses should be stored in the history after the Alt release, since Search + // was never released in the first place. crbug.com/704280. + if (accelerator.key_state() == Accelerator::KeyState::PRESSED) { + if (!currently_pressed_keys_.emplace(accelerator.key_code()).second) + return; + } else { + currently_pressed_keys_.erase(accelerator.key_code()); + } + if (accelerator != current_accelerator_) { previous_accelerator_ = current_accelerator_; current_accelerator_ = accelerator;
diff --git a/ui/base/accelerators/accelerator_history.h b/ui/base/accelerators/accelerator_history.h index 22aaf1f..ee63a572 100644 --- a/ui/base/accelerators/accelerator_history.h +++ b/ui/base/accelerators/accelerator_history.h
@@ -5,12 +5,11 @@ #ifndef UI_BASE_ACCELERATORS_ACCELERATOR_HISTORY_H_ #define UI_BASE_ACCELERATORS_ACCELERATOR_HISTORY_H_ +#include <set> + #include "base/macros.h" -#include "base/memory/singleton.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/ui_base_export.h" -#include "ui/events/event.h" -#include "ui/events/event_handler.h" namespace ui { @@ -40,6 +39,8 @@ Accelerator current_accelerator_; Accelerator previous_accelerator_; + std::set<KeyboardCode> currently_pressed_keys_; + DISALLOW_COPY_AND_ASSIGN(AcceleratorHistory); };
diff --git a/ui/base/accelerators/accelerator_history_unittest.cc b/ui/base/accelerators/accelerator_history_unittest.cc new file mode 100644 index 0000000..4fcf29a4 --- /dev/null +++ b/ui/base/accelerators/accelerator_history_unittest.cc
@@ -0,0 +1,55 @@ +// Copyright 2017 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 "ui/base/accelerators/accelerator_history.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace ui { + +TEST(AcceleratorHistoryTest, SimulatePressAndHold) { + AcceleratorHistory history; + Accelerator alt_press(ui::VKEY_MENU, ui::EF_NONE, + ui::Accelerator::KeyState::PRESSED); + history.StoreCurrentAccelerator(alt_press); + EXPECT_EQ(alt_press, history.current_accelerator()); + + // Repeats don't affect previous accelerators. + history.StoreCurrentAccelerator(alt_press); + EXPECT_EQ(alt_press, history.current_accelerator()); + EXPECT_NE(alt_press, history.previous_accelerator()); + + Accelerator search_alt_press(ui::VKEY_LWIN, ui::EF_ALT_DOWN, + ui::Accelerator::KeyState::PRESSED); + history.StoreCurrentAccelerator(search_alt_press); + EXPECT_EQ(search_alt_press, history.current_accelerator()); + EXPECT_EQ(alt_press, history.previous_accelerator()); + history.StoreCurrentAccelerator(search_alt_press); + EXPECT_EQ(search_alt_press, history.current_accelerator()); + EXPECT_EQ(alt_press, history.previous_accelerator()); + + Accelerator alt_release_search_down(ui::VKEY_MENU, ui::EF_COMMAND_DOWN, + ui::Accelerator::KeyState::RELEASED); + history.StoreCurrentAccelerator(alt_release_search_down); + EXPECT_EQ(alt_release_search_down, history.current_accelerator()); + EXPECT_EQ(search_alt_press, history.previous_accelerator()); + + // Search is still down and search presses will keep being generated, but from + // the perspective of the AcceleratorHistory, this is the same Search press + // that hasn't been released yet. + Accelerator search_press(ui::VKEY_LWIN, ui::EF_NONE, + ui::Accelerator::KeyState::PRESSED); + history.StoreCurrentAccelerator(search_press); + history.StoreCurrentAccelerator(search_press); + history.StoreCurrentAccelerator(search_press); + EXPECT_EQ(alt_release_search_down, history.current_accelerator()); + EXPECT_EQ(search_alt_press, history.previous_accelerator()); + + Accelerator search_release(ui::VKEY_LWIN, ui::EF_NONE, + ui::Accelerator::KeyState::RELEASED); + history.StoreCurrentAccelerator(search_release); + EXPECT_EQ(search_release, history.current_accelerator()); + EXPECT_EQ(alt_release_search_down, history.previous_accelerator()); +} + +} // namespace ui
diff --git a/ui/base/cursor/cursor_loader_ozone.cc b/ui/base/cursor/cursor_loader_ozone.cc index 08b831e6..1d74eec7 100644 --- a/ui/base/cursor/cursor_loader_ozone.cc +++ b/ui/base/cursor/cursor_loader_ozone.cc
@@ -24,8 +24,8 @@ GetImageCursorBitmap(resource_id, scale(), rotation(), &hotspot, &bitmap); - cursors_[id] = - CursorFactoryOzone::GetInstance()->CreateImageCursor(bitmap, hotspot); + cursors_[id] = CursorFactoryOzone::GetInstance()->CreateImageCursor( + bitmap, hotspot, scale()); } void CursorLoaderOzone::LoadAnimatedCursor(int id, @@ -39,7 +39,7 @@ resource_id, scale(), rotation(), &hotspot, &bitmaps); cursors_[id] = CursorFactoryOzone::GetInstance()->CreateAnimatedCursor( - bitmaps, hotspot, frame_delay_ms); + bitmaps, hotspot, frame_delay_ms, scale()); } void CursorLoaderOzone::UnloadAll() {
diff --git a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc index f96d98fb..ab052ca 100644 --- a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc +++ b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc
@@ -79,7 +79,8 @@ PlatformCursor BitmapCursorFactoryOzone::CreateImageCursor( const SkBitmap& bitmap, - const gfx::Point& hotspot) { + const gfx::Point& hotspot, + float bitmap_dpi) { BitmapCursorOzone* cursor = new BitmapCursorOzone(bitmap, hotspot); cursor->AddRef(); // Balanced by UnrefImageCursor. return ToPlatformCursor(cursor); @@ -88,7 +89,8 @@ PlatformCursor BitmapCursorFactoryOzone::CreateAnimatedCursor( const std::vector<SkBitmap>& bitmaps, const gfx::Point& hotspot, - int frame_delay_ms) { + int frame_delay_ms, + float bitmap_dpi) { DCHECK_LT(0U, bitmaps.size()); BitmapCursorOzone* cursor = new BitmapCursorOzone(bitmaps, hotspot, frame_delay_ms);
diff --git a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h index e621c5e..de7352d 100644 --- a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h +++ b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h
@@ -63,11 +63,12 @@ // CursorFactoryOzone: PlatformCursor GetDefaultCursor(int type) override; PlatformCursor CreateImageCursor(const SkBitmap& bitmap, - const gfx::Point& hotspot) override; - PlatformCursor CreateAnimatedCursor( - const std::vector<SkBitmap>& bitmaps, - const gfx::Point& hotspot, - int frame_delay_ms) override; + const gfx::Point& hotspot, + float bitmap_dpi) override; + PlatformCursor CreateAnimatedCursor(const std::vector<SkBitmap>& bitmaps, + const gfx::Point& hotspot, + int frame_delay_ms, + float bitmap_dpi) override; void RefImageCursor(PlatformCursor cursor) override; void UnrefImageCursor(PlatformCursor cursor) override;
diff --git a/ui/base/cursor/ozone/cursor_data_factory_ozone.cc b/ui/base/cursor/ozone/cursor_data_factory_ozone.cc new file mode 100644 index 0000000..7d900d4b --- /dev/null +++ b/ui/base/cursor/ozone/cursor_data_factory_ozone.cc
@@ -0,0 +1,108 @@ +// Copyright 2017 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 "ui/base/cursor/ozone/cursor_data_factory_ozone.h" + +#include "ui/base/cursor/cursor.h" + +namespace ui { + +namespace { + +// A magic value that we store at the start of an instance. +const uint32_t kCookie = 0xF60D214C; + +const uint32_t kBadCookie = 0xBADBADCC; + +CursorDataOzone* ToCursorDataOzone(PlatformCursor cursor) { + CursorDataOzone* ozone = static_cast<CursorDataOzone*>(cursor); +#if DCHECK_IS_ON() + ozone->AssertIsACusrorDataOzone(); +#endif + return ozone; +} + +PlatformCursor ToPlatformCursor(CursorDataOzone* cursor) { + return static_cast<PlatformCursor>(cursor); +} + +} // namespace + +CursorDataOzone::CursorDataOzone(const ui::CursorData& data) + : magic_cookie_(kCookie), data_(data) {} + +void CursorDataOzone::AssertIsACusrorDataOzone() { + CHECK_EQ(magic_cookie_, kCookie); +} + +CursorDataOzone::~CursorDataOzone() { + magic_cookie_ = kBadCookie; +} + +CursorDataFactoryOzone::CursorDataFactoryOzone() {} + +CursorDataFactoryOzone::~CursorDataFactoryOzone() {} + +// static +const ui::CursorData& CursorDataFactoryOzone::GetCursorData( + PlatformCursor platform_cursor) { + return ToCursorDataOzone(platform_cursor)->data(); +} + +PlatformCursor CursorDataFactoryOzone::GetDefaultCursor(int type) { + // Unlike BitmapCursorFactoryOzone, we aren't making heavyweight bitmaps, but + // we still have to cache these forever because objects that come out of the + // GetDefaultCursor() method aren't treated as refcounted by the ozone + // interfaces. + return GetDefaultCursorInternal(type).get(); +} + +PlatformCursor CursorDataFactoryOzone::CreateImageCursor( + const SkBitmap& bitmap, + const gfx::Point& hotspot, + float bitmap_dpi) { + CursorDataOzone* cursor = new CursorDataOzone( + ui::CursorData(hotspot, {bitmap}, bitmap_dpi, base::TimeDelta())); + cursor->AddRef(); // Balanced by UnrefImageCursor. + return ToPlatformCursor(cursor); +} + +PlatformCursor CursorDataFactoryOzone::CreateAnimatedCursor( + const std::vector<SkBitmap>& bitmaps, + const gfx::Point& hotspot, + int frame_delay_ms, + float bitmap_dpi) { + CursorDataOzone* cursor = new CursorDataOzone( + ui::CursorData(hotspot, bitmaps, bitmap_dpi, + base::TimeDelta::FromMilliseconds(frame_delay_ms))); + cursor->AddRef(); // Balanced by UnrefImageCursor. + return ToPlatformCursor(cursor); +} + +void CursorDataFactoryOzone::RefImageCursor(PlatformCursor cursor) { + ToCursorDataOzone(cursor)->AddRef(); +} + +void CursorDataFactoryOzone::UnrefImageCursor(PlatformCursor cursor) { + ToCursorDataOzone(cursor)->Release(); +} + +scoped_refptr<CursorDataOzone> CursorDataFactoryOzone::GetDefaultCursorInternal( + int type) { + if (type == kCursorNone) + return nullptr; // nullptr is used for hidden cursor. + + if (!default_cursors_.count(type)) { + // We hold a ref forever because clients do not do refcounting for default + // cursors. + scoped_refptr<CursorDataOzone> cursor = + make_scoped_refptr(new CursorDataOzone(ui::CursorData(type))); + default_cursors_[type] = std::move(cursor); + } + + // Returned owned default cursor for this type. + return default_cursors_[type]; +} + +} // namespace ui
diff --git a/ui/base/cursor/ozone/cursor_data_factory_ozone.h b/ui/base/cursor/ozone/cursor_data_factory_ozone.h new file mode 100644 index 0000000..5db5d1e --- /dev/null +++ b/ui/base/cursor/ozone/cursor_data_factory_ozone.h
@@ -0,0 +1,91 @@ +// Copyright 2017 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 UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_ +#define UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_ + +#include <map> + +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/cursor/cursor_data.h" +#include "ui/base/ui_base_export.h" +#include "ui/gfx/geometry/point.h" +#include "ui/ozone/public/cursor_factory_ozone.h" + +namespace ui { + +// A refcounted wrapper around a ui::CursorData to obey CursorFactoryOzone's +// refcounting interface while building ui::CursorData objects for transport +// over mojo pipes. +// +// TODO(erg): In the long term, this should go away. When //content/ switches +// from webcursor.h to use ui::CursorData directly, we should be able to get +// rid of this class which is an adaptor for the existing ozone code. +class UI_BASE_EXPORT CursorDataOzone + : public base::RefCounted<CursorDataOzone> { + public: + explicit CursorDataOzone(const ui::CursorData& data); + + const ui::CursorData& data() const { return data_; } + + // Instances of CursorDataOzone are passed around as void* because of the low + // level CursorFactoryOzone interface. Even worse, there can be multiple + // subclasses that map to this void* type. This asserts that a magic cookie + // that we put at the start of valid CursorDataOzone objects is correct. + void AssertIsACusrorDataOzone(); + + private: + friend class base::RefCounted<CursorDataOzone>; + ~CursorDataOzone(); + + // This is always a magic constant value. This is set in the constructor and + // unset in the destructor. + uint32_t magic_cookie_; + + ui::CursorData data_; + + DISALLOW_COPY_AND_ASSIGN(CursorDataOzone); +}; + +// CursorFactoryOzone implementation for processes which use ui::CursorDatas. +// +// Inside some sandboxed processes, we need to save all source data so it can +// be processed in a remote process. This plugs into the current ozone cursor +// creating code, and builds the cross platform mojo data structure. +class UI_BASE_EXPORT CursorDataFactoryOzone : public CursorFactoryOzone { + public: + CursorDataFactoryOzone(); + ~CursorDataFactoryOzone() override; + + // Converts a PlatformCursor back to a ui::CursorData. + static const ui::CursorData& GetCursorData(PlatformCursor platform_cursor); + + // CursorFactoryOzone: + PlatformCursor GetDefaultCursor(int type) override; + PlatformCursor CreateImageCursor(const SkBitmap& bitmap, + const gfx::Point& hotspot, + float bitmap_dpi) override; + PlatformCursor CreateAnimatedCursor(const std::vector<SkBitmap>& bitmaps, + const gfx::Point& hotspot, + int frame_delay_ms, + float bitmap_dpi) override; + void RefImageCursor(PlatformCursor cursor) override; + void UnrefImageCursor(PlatformCursor cursor) override; + + private: + // Get cached BitmapCursorOzone for a default cursor. + scoped_refptr<CursorDataOzone> GetDefaultCursorInternal(int type); + + // Default cursors are cached & owned by the factory. + typedef std::map<int, scoped_refptr<CursorDataOzone>> DefaultCursorMap; + DefaultCursorMap default_cursors_; + + DISALLOW_COPY_AND_ASSIGN(CursorDataFactoryOzone); +}; + +} // namespace ui + +#endif // UI_BASE_CURSOR_OZONE_CURSORD_DATA_FACTORY_OZONE_H_
diff --git a/ui/file_manager/externs/compiled_resources2.gyp b/ui/file_manager/externs/compiled_resources2.gyp index f56f50f..9931d52 100644 --- a/ui/file_manager/externs/compiled_resources2.gyp +++ b/ui/file_manager/externs/compiled_resources2.gyp
@@ -1,6 +1,11 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. +# Copyright 2017 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. + +######################################################## +# NOTE: THIS FILE IS GENERATED. DO NOT EDIT IT! # +# Instead, run create_include_gyp.py to regenerate it. # +######################################################## { 'targets': [ { @@ -16,7 +21,7 @@ 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], }, { - 'target_name': 'byte_reader', + 'target_name': 'background_window_common', 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], }, { @@ -108,10 +113,6 @@ 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], }, { - 'target_name': 'metadata_parser_interface', - 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], - }, - { 'target_name': 'metadata_worker_window', 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], }, @@ -128,18 +129,10 @@ 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], }, { - 'target_name': 'progress_center_panel', - 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], - }, - { 'target_name': 'search_item', 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], }, { - 'target_name': 'video_player_foreground', - 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], - }, - { 'target_name': 'volume_info', 'includes': ['../../../third_party/closure_compiler/include_js.gypi'], },
diff --git a/ui/file_manager/externs/progress_center_panel.js b/ui/file_manager/externs/progress_center_panel.js deleted file mode 100644 index ee11105..0000000 --- a/ui/file_manager/externs/progress_center_panel.js +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2017 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. - -/** - * @constructor - * @struct - */ -function ProgressCenterPanel() {} - -/** - * @param {string} id - */ -ProgressCenterPanel.prototype.dismissErrorItem = function(id) {}; - -/** - * @param {!ProgressCenterItem} item - */ -ProgressCenterPanel.prototype.updateItem = function(item) {}; - -/** @type {?function(string)} */ -ProgressCenterPanel.prototype.cancelCallback; - -/** @type {?function(string)} */ -ProgressCenterPanel.prototype.dismissErrorItemCallback;
diff --git a/ui/file_manager/file_manager/background/js/compiled_resources2.gyp b/ui/file_manager/file_manager/background/js/compiled_resources2.gyp index 7b8d0bd..19beee0d 100644 --- a/ui/file_manager/file_manager/background/js/compiled_resources2.gyp +++ b/ui/file_manager/file_manager/background/js/compiled_resources2.gyp
@@ -202,10 +202,10 @@ { 'target_name': 'progress_center', 'dependencies': [ - '../../../externs/compiled_resources2.gyp:progress_center_panel', '../../common/js/compiled_resources2.gyp:async_util', '../../common/js/compiled_resources2.gyp:progress_center_common', '../../common/js/compiled_resources2.gyp:util', + '../../foreground/js/ui/compiled_resources2.gyp:progress_center_panel', '<(EXTERNS_GYP):chrome_extensions', ], 'includes': ['../../../compile_js2.gypi'],
diff --git a/ui/file_manager/file_manager/foreground/js/actions_model.js b/ui/file_manager/file_manager/foreground/js/actions_model.js index 1424a91c..5d2129e 100644 --- a/ui/file_manager/file_manager/foreground/js/actions_model.js +++ b/ui/file_manager/file_manager/foreground/js/actions_model.js
@@ -24,8 +24,18 @@ }; /** + * @typedef {{ + * alertDialog: FilesAlertDialog, + * errorDialog: ErrorDialog, + * listContainer: ListContainer, + * shareDialog: ShareDialog, + * }} + */ +var ActionModelUI; + +/** * @param {!Entry} entry - * @param {!FileManagerUI} ui + * @param {!ActionModelUI} ui * @param {!VolumeManagerWrapper} volumeManager * @implements {Action} * @constructor @@ -45,7 +55,7 @@ this.volumeManager_ = volumeManager; /** - * @private {!FileManagerUI} + * @private {!ActionModelUI} * @const */ this.ui_ = ui; @@ -53,7 +63,7 @@ /** * @param {!Array<!Entry>} entries - * @param {!FileManagerUI} ui + * @param {!ActionModelUI} ui * @param {!VolumeManagerWrapper} volumeManager * @return {DriveShareAction} */ @@ -93,7 +103,7 @@ * @param {!Array<!Entry>} entries * @param {!MetadataModel} metadataModel * @param {!DriveSyncHandler} driveSyncHandler - * @param {!FileManagerUI} ui + * @param {!ActionModelUI} ui * @param {boolean} value * @param {function()} onExecute * @implements {Action} @@ -121,7 +131,7 @@ this.driveSyncHandler_ = driveSyncHandler; /** - * @private {!FileManagerUI} + * @private {!ActionModelUI} * @const */ this.ui_ = ui; @@ -143,7 +153,7 @@ * @param {!Array<!Entry>} entries * @param {!MetadataModel} metadataModel * @param {!DriveSyncHandler} driveSyncHandler - * @param {!FileManagerUI} ui + * @param {!ActionModelUI} ui * @param {boolean} value * @param {function()} onExecute * @return {DriveToggleOfflineAction} @@ -459,7 +469,7 @@ * @param {!MetadataModel} metadataModel * @param {!FolderShortcutsDataModel} shortcutsModel * @param {!DriveSyncHandler} driveSyncHandler - * @param {!FileManagerUI} ui + * @param {!ActionModelUI} ui * @param {!Array<!Entry>} entries * @constructor * @extends {cr.EventTarget} @@ -493,7 +503,7 @@ this.driveSyncHandler_ = driveSyncHandler; /** - * @private {!FileManagerUI} + * @private {!ActionModelUI} * @const */ this.ui_ = ui;
diff --git a/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp b/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp index 9a1958b5..12419df3 100644 --- a/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp +++ b/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp
@@ -14,17 +14,21 @@ # ], # 'includes': ['../../../compile_js2.gypi'], # }, -# { -# 'target_name': 'actions_model', -# 'dependencies': [ -# '../../background/js/compiled_resources2.gyp:drive_sync_handler', -# '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', -# '<(EXTERNS_GYP):file_manager_private', -# 'folder_shortcuts_data_model', -# 'metadata/compiled_resources2.gyp:metadata_model', -# ], -# 'includes': ['../../../compile_js2.gypi'], -# }, + { + 'target_name': 'actions_model', + 'dependencies': [ + '../../background/js/compiled_resources2.gyp:drive_sync_handler', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', + '<(EXTERNS_GYP):file_manager_private', + 'folder_shortcuts_data_model', + 'metadata/compiled_resources2.gyp:metadata_model', + 'ui/compiled_resources2.gyp:error_dialog', + 'ui/compiled_resources2.gyp:files_alert_dialog', + 'ui/compiled_resources2.gyp:list_container', + 'ui/compiled_resources2.gyp:share_dialog', + ], + 'includes': ['../../../compile_js2.gypi'], + }, # { # 'target_name': 'app_state_controller', # 'includes': ['../../../compile_js2.gypi'],
diff --git a/ui/file_manager/file_manager/foreground/js/ui/compiled_resources2.gyp b/ui/file_manager/file_manager/foreground/js/ui/compiled_resources2.gyp index 4e45d9d5..2b41bb9 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/compiled_resources2.gyp +++ b/ui/file_manager/file_manager/foreground/js/ui/compiled_resources2.gyp
@@ -3,14 +3,16 @@ # found in the LICENSE file. { 'targets': [ -# { -# 'target_name': 'actions_submenu', -# 'dependencies': [ -# '../compiled_resources2.gyp:actions_model', -# '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:command', -# ], -# 'includes': ['../../../../compile_js2.gypi'], -# }, + { + 'target_name': 'actions_submenu', + 'dependencies': [ + '../compiled_resources2.gyp:actions_model', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:command', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:menu', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:menu_item', + ], + 'includes': ['../../../../compile_js2.gypi'], + }, { 'target_name': 'banners', 'dependencies': [ @@ -138,10 +140,43 @@ ], 'includes': ['../../../../compile_js2.gypi'], }, -# { -# 'target_name': 'file_manager_ui', -# 'includes': ['../../../../compile_js2.gypi'], -# }, + { + 'target_name': 'file_manager_ui', + 'dependencies': [ + '../../../common/js/compiled_resources2.gyp:util', + '../../elements/compiled_resources2.gyp:files_toggle_ripple', + '../../elements/compiled_resources2.gyp:files_tooltip', + '../compiled_resources2.gyp:launch_param', + '../compiled_resources2.gyp:providers_model', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_template_no_process', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:context_menu_button', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:dialogs', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:menu', + 'actions_submenu', + 'banners', + 'combobutton', + 'default_task_dialog', + 'dialog_footer', + 'directory_tree', + 'empty_folder', + 'error_dialog', + 'file_grid', + 'file_table', + 'files_alert_dialog', + 'files_confirm_dialog', + 'gear_menu', + 'list_container', + 'location_line', + 'multi_profile_share_dialog', + 'progress_center_panel', + 'providers_menu', + 'search_box', + 'share_dialog', + 'suggest_apps_dialog', + ], + 'includes': ['../../../../compile_js2.gypi'], + }, { 'target_name': 'file_metadata_formatter', 'dependencies': [
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc index 47347f3c..d9f66426 100644 --- a/ui/gfx/canvas.cc +++ b/ui/gfx/canvas.cc
@@ -103,17 +103,6 @@ return base::i18n::IsRTL() ? TEXT_ALIGN_RIGHT : TEXT_ALIGN_LEFT; } -ImageSkiaRep Canvas::ExtractImageRep() const { - DCHECK(bitmap_); - SkBitmap bitmap_copy; - // copyTo() will perform a deep copy, which is what we want. - bool result = bitmap_->copyTo(&bitmap_copy); - // This should succeed since the destination bitmap is empty to begin with. - // The only failure is an allocation failure, which we want to DCHECK anyway. - DCHECK(result); - return ImageSkiaRep(bitmap_copy, image_scale_); -} - void Canvas::DrawDashedRect(const RectF& rect, SkColor color) { if (rect.IsEmpty()) return;
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h index 5abe1976..a70ce25f 100644 --- a/ui/gfx/canvas.h +++ b/ui/gfx/canvas.h
@@ -147,9 +147,6 @@ // Canvas::TEXT_ALIGN_RIGHT. static int DefaultCanvasTextAlignment(); - // Extracts an ImageSkiaRep from the contents of this canvas. - ImageSkiaRep ExtractImageRep() const; - // Draws a dashed rectangle of the specified color. void DrawDashedRect(const RectF& rect, SkColor color);
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc index 18ee267e..042986f8 100644 --- a/ui/gfx/render_text_harfbuzz.cc +++ b/ui/gfx/render_text_harfbuzz.cc
@@ -1202,7 +1202,6 @@ ShapeRunList(display_text, display_run_list_.get()); } update_display_run_list_ = false; - std::vector<internal::Line> empty_lines; set_lines(&empty_lines); } @@ -1648,13 +1647,13 @@ ShapeRunList(text, &layout_run_list_); } - std::vector<internal::Line> empty_lines; - set_lines(&empty_lines); display_run_list_.reset(); update_display_text_ = true; update_layout_run_list_ = false; } if (update_display_text_) { + std::vector<internal::Line> empty_lines; + set_lines(&empty_lines); UpdateDisplayText(multiline() ? 0 : layout_run_list_.width()); update_display_text_ = false; update_display_run_list_ = text_elided();
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index d262f5f..0e1e3b49 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc
@@ -534,6 +534,10 @@ return GetRenderText()->GetLineOffset(line_num).y() + 1; } + // Do not use this function to ensure layout. This is only used to run a + // subset of the EnsureLayout functionality and check intermediate state. + void EnsureLayoutRunList() { GetRenderTextHarfBuzz()->EnsureLayoutRunList(); } + private: DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzzTest); }; @@ -3963,6 +3967,17 @@ EXPECT_GT(text.size(), static_cast<size_t>(glyph_count)); EXPECT_NE(0, glyph_count); } + +TEST_P(RenderTextMacTest, LinesInvalidationOnElideBehaviorChange) { + RenderTextMac* render_text = GetRenderTextMac(); + render_text->SetText(ASCIIToUTF16("This is an example")); + test_api()->EnsureLayout(); + EXPECT_TRUE(GetCoreTextLine()); + + // Lines are cleared when elide behavior changes. + render_text->SetElideBehavior(gfx::ELIDE_TAIL); + EXPECT_FALSE(GetCoreTextLine()); +} #endif // defined(OS_MACOSX) // Ensure color changes are picked up by the RenderText implementation. @@ -4409,6 +4424,18 @@ DrawVisualText(); } +TEST_P(RenderTextHarfBuzzTest, LinesInvalidationOnElideBehaviorChange) { + RenderTextHarfBuzz* render_text = GetRenderTextHarfBuzz(); + render_text->SetText(ASCIIToUTF16("This is an example")); + test_api()->EnsureLayout(); + EXPECT_FALSE(test_api()->lines().empty()); + + // Lines are cleared when elide behavior changes. + render_text->SetElideBehavior(gfx::ELIDE_TAIL); + EnsureLayoutRunList(); + EXPECT_TRUE(test_api()->lines().empty()); +} + // Ensures that text is centered vertically and consistently when either the // display rectangle height changes, or when the minimum line height changes. // The difference between the two is the selection rectangle, which should match
diff --git a/ui/gl/PRESUBMIT.py b/ui/gl/PRESUBMIT.py new file mode 100644 index 0000000..dad553d --- /dev/null +++ b/ui/gl/PRESUBMIT.py
@@ -0,0 +1,31 @@ +# Copyright (c) 2017 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. + +"""Presubmit script for //ui/gl. + +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts +for more details about the presubmit API built into depot_tools. +""" + +def PostUploadHook(cl, change, output_api): + """git cl upload will call this hook after the issue is created/modified. + + This hook modifies the CL description in order to run extra GPU + tests (in particular, the WebGL 2.0 conformance tests) in addition + to the regular CQ try bots. This test suite is too large to run + against all Chromium commits, but should be run against changes + likely to affect these tests. + + When adding/removing tests here, ensure that both gpu/PRESUBMIT.py and + ui/gl/PRESUBMIT.py are updated. + """ + return output_api.EnsureCQIncludeTrybotsAreAdded( + cl, + [ + 'master.tryserver.chromium.linux:linux_optional_gpu_tests_rel', + 'master.tryserver.chromium.mac:mac_optional_gpu_tests_rel', + 'master.tryserver.chromium.win:win_optional_gpu_tests_rel', + 'master.tryserver.chromium.android:android_optional_gpu_tests_rel', + ], + 'Automatically added optional GPU tests to run on CQ.')
diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc index 5c2a462..d2cfc1fb 100644 --- a/ui/native_theme/native_theme_aura.cc +++ b/ui/native_theme/native_theme_aura.cc
@@ -33,7 +33,6 @@ // Constants for painting overlay scrollbars. Other properties needed outside // this painting code are defined in overlay_scrollbar_constants_aura.h. -constexpr int kOverlayScrollbarStrokeWidth = 1; constexpr int kOverlayScrollbarMinimumLength = 32; // 2 pixel border with 1 pixel center patch. The border is 2 pixels despite the @@ -73,7 +72,7 @@ if (use_overlay_scrollbars_) { scrollbar_width_ = - kOverlayScrollbarThumbWidthPressed + kOverlayScrollbarStrokeWidth * 2; + kOverlayScrollbarThumbWidthPressed + kOverlayScrollbarStrokeWidth; } // Images and alphas declarations assume the following order. @@ -199,14 +198,6 @@ SkColor thumb_color; if (use_overlay_scrollbars_) { - // Constants used for painting overlay scrollbar thumb. - constexpr SkAlpha kOverlayScrollbarFillAlphaNormal = 0x80; - constexpr SkAlpha kOverlayScrollbarFillAlphaHovered = 0xB3; - constexpr SkAlpha kOverlayScrollbarFillAlphaPressed = 0xB3; - constexpr SkAlpha kOverlayScrollbarStrokeAlphaNormal = 0x4D; - constexpr SkAlpha kOverlayScrollbarStrokeAlphaHovered = 0x80; - constexpr SkAlpha kOverlayScrollbarStrokeAlphaPressed = 0x80; - // Indexed by ScrollbarOverlayColorTheme. constexpr SkColor kOverlayScrollbarThumbColor[] = {SK_ColorBLACK, SK_ColorWHITE}; @@ -222,16 +213,16 @@ stroke_alpha = SK_AlphaTRANSPARENT; break; case NativeTheme::kHovered: - thumb_alpha = kOverlayScrollbarFillAlphaHovered; - stroke_alpha = kOverlayScrollbarStrokeAlphaHovered; + thumb_alpha = SK_AlphaOPAQUE * kOverlayScrollbarThumbHoverAlpha; + stroke_alpha = SK_AlphaOPAQUE * kOverlayScrollbarStrokeHoverAlpha; break; case NativeTheme::kNormal: - thumb_alpha = kOverlayScrollbarFillAlphaNormal; - stroke_alpha = kOverlayScrollbarStrokeAlphaNormal; + thumb_alpha = SK_AlphaOPAQUE * kOverlayScrollbarThumbNormalAlpha; + stroke_alpha = SK_AlphaOPAQUE * kOverlayScrollbarStrokeNormalAlpha; break; case NativeTheme::kPressed: - thumb_alpha = kOverlayScrollbarFillAlphaPressed; - stroke_alpha = kOverlayScrollbarStrokeAlphaPressed; + thumb_alpha = SK_AlphaOPAQUE * kOverlayScrollbarThumbHoverAlpha; + stroke_alpha = SK_AlphaOPAQUE * kOverlayScrollbarStrokeHoverAlpha; break; case NativeTheme::kNumStates: NOTREACHED(); @@ -247,21 +238,21 @@ flags.setStrokeWidth(kStrokeWidth); gfx::RectF stroke_rect(thumb_rect); - constexpr float kHalfStrokeWidth = kStrokeWidth / 2.f; - stroke_rect.Inset(kHalfStrokeWidth, kHalfStrokeWidth); + gfx::InsetsF stroke_insets(kStrokeWidth / 2.f); + // The edge to which the scrollbar is attached shouldn't have a border. + gfx::Insets edge_adjust_insets; + if (part == NativeTheme::kScrollbarHorizontalThumb) + edge_adjust_insets = gfx::Insets(0, 0, -kStrokeWidth, 0); + else + edge_adjust_insets = gfx::Insets(0, 0, 0, -kStrokeWidth); + stroke_rect.Inset(stroke_insets + edge_adjust_insets); canvas->drawRect(gfx::RectFToSkRect(stroke_rect), flags); // Inset the all the edges edges so we fill-in the stroke below. - // The edge to which the scrollbar is attached shouldn't have a border. // For left vertical scrollbar, we will horizontally flip the canvas in // ScrollbarThemeOverlay::paintThumb. - gfx::Insets insets(kStrokeWidth); - if (part == NativeTheme::kScrollbarHorizontalThumb) - insets -= gfx::Insets(0, 0, kStrokeWidth, 0); - else - insets -= gfx::Insets(0, 0, 0, kStrokeWidth); - - thumb_rect.Inset(insets); + gfx::Insets fill_insets(kStrokeWidth); + thumb_rect.Inset(fill_insets + edge_adjust_insets); } else { switch (state) { case NativeTheme::kDisabled:
diff --git a/ui/native_theme/overlay_scrollbar_constants_aura.h b/ui/native_theme/overlay_scrollbar_constants_aura.h index 6553799..a6192d9 100644 --- a/ui/native_theme/overlay_scrollbar_constants_aura.h +++ b/ui/native_theme/overlay_scrollbar_constants_aura.h
@@ -10,10 +10,14 @@ namespace ui { -constexpr int kOverlayScrollbarThumbWidthNormal = 6; -constexpr int kOverlayScrollbarThumbWidthHovered = 10; +constexpr int kOverlayScrollbarStrokeWidth = 1; constexpr int kOverlayScrollbarThumbWidthPressed = 10; +constexpr float kOverlayScrollbarThumbNormalAlpha = 0.5f; +constexpr float kOverlayScrollbarThumbHoverAlpha = 0.7f; +constexpr float kOverlayScrollbarStrokeNormalAlpha = 0.3f; +constexpr float kOverlayScrollbarStrokeHoverAlpha = 0.5f; + // kOverlayScrollbarShowDelay is only for the case where the mouse hovers near // the screen edge. constexpr base::TimeDelta kOverlayScrollbarShowDelay =
diff --git a/ui/ozone/platform/x11/x11_cursor_factory_ozone.cc b/ui/ozone/platform/x11/x11_cursor_factory_ozone.cc index 50df691..97106f1 100644 --- a/ui/ozone/platform/x11/x11_cursor_factory_ozone.cc +++ b/ui/ozone/platform/x11/x11_cursor_factory_ozone.cc
@@ -43,7 +43,8 @@ PlatformCursor X11CursorFactoryOzone::CreateImageCursor( const SkBitmap& bitmap, - const gfx::Point& hotspot) { + const gfx::Point& hotspot, + float bitmap_dpi) { // There is a problem with custom cursors that have no custom data. The // resulting SkBitmap is empty and X crashes when creating a zero size cursor // image. Return invisible cursor here instead. @@ -59,7 +60,8 @@ PlatformCursor X11CursorFactoryOzone::CreateAnimatedCursor( const std::vector<SkBitmap>& bitmaps, const gfx::Point& hotspot, - int frame_delay_ms) { + int frame_delay_ms, + float bitmap_dpi) { X11CursorOzone* cursor = new X11CursorOzone(bitmaps, hotspot, frame_delay_ms); cursor->AddRef(); return ToPlatformCursor(cursor);
diff --git a/ui/ozone/platform/x11/x11_cursor_factory_ozone.h b/ui/ozone/platform/x11/x11_cursor_factory_ozone.h index 8e851ff4..a186a821 100644 --- a/ui/ozone/platform/x11/x11_cursor_factory_ozone.h +++ b/ui/ozone/platform/x11/x11_cursor_factory_ozone.h
@@ -27,10 +27,12 @@ // CursorFactoryOzone: PlatformCursor GetDefaultCursor(int type) override; PlatformCursor CreateImageCursor(const SkBitmap& bitmap, - const gfx::Point& hotspot) override; + const gfx::Point& hotspot, + float bitmap_dpi) override; PlatformCursor CreateAnimatedCursor(const std::vector<SkBitmap>& bitmaps, const gfx::Point& hotspot, - int frame_delay_ms) override; + int frame_delay_ms, + float bitmap_dpi) override; void RefImageCursor(PlatformCursor cursor) override; void UnrefImageCursor(PlatformCursor cursor) override;
diff --git a/ui/ozone/public/cursor_factory_ozone.cc b/ui/ozone/public/cursor_factory_ozone.cc index c7f388dc..fa075bb 100644 --- a/ui/ozone/public/cursor_factory_ozone.cc +++ b/ui/ozone/public/cursor_factory_ozone.cc
@@ -31,9 +31,9 @@ return NULL; } -PlatformCursor CursorFactoryOzone::CreateImageCursor( - const SkBitmap& bitmap, - const gfx::Point& hotspot) { +PlatformCursor CursorFactoryOzone::CreateImageCursor(const SkBitmap& bitmap, + const gfx::Point& hotspot, + float bitmap_dpi) { NOTIMPLEMENTED(); return NULL; } @@ -41,7 +41,8 @@ PlatformCursor CursorFactoryOzone::CreateAnimatedCursor( const std::vector<SkBitmap>& bitmaps, const gfx::Point& hotspot, - int frame_delay_ms) { + int frame_delay_ms, + float bitmap_dpi) { NOTIMPLEMENTED(); return NULL; }
diff --git a/ui/ozone/public/cursor_factory_ozone.h b/ui/ozone/public/cursor_factory_ozone.h index 4950a31..dbc3c751 100644 --- a/ui/ozone/public/cursor_factory_ozone.h +++ b/ui/ozone/public/cursor_factory_ozone.h
@@ -35,7 +35,8 @@ // are referenced counted and have an initial refcount of 1. Therefore, each // CreateImageCursor call must be matched with a call to UnrefImageCursor. virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap, - const gfx::Point& hotspot); + const gfx::Point& hotspot, + float bitmap_dpi); // Return a animated cursor from the specified image & hotspot. Animated // cursors are referenced counted and have an initial refcount of 1. @@ -44,7 +45,8 @@ virtual PlatformCursor CreateAnimatedCursor( const std::vector<SkBitmap>& bitmaps, const gfx::Point& hotspot, - int frame_delay_ms); + int frame_delay_ms, + float bitmap_dpi); // Increment platform image cursor refcount. virtual void RefImageCursor(PlatformCursor cursor);
diff --git a/ui/views/controls/scrollbar/overlay_scroll_bar.cc b/ui/views/controls/scrollbar/overlay_scroll_bar.cc index ae0c2619..0ed8d62 100644 --- a/ui/views/controls/scrollbar/overlay_scroll_bar.cc +++ b/ui/views/controls/scrollbar/overlay_scroll_bar.cc
@@ -9,6 +9,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/canvas.h" +#include "ui/native_theme/overlay_scrollbar_constants_aura.h" #include "ui/views/background.h" #include "ui/views/border.h" @@ -16,13 +17,15 @@ namespace { // Total thickness of the thumb (matches visuals when hovered). -const int kThumbThickness = 11; +constexpr int kThumbThickness = + ui::kOverlayScrollbarThumbWidthPressed + ui::kOverlayScrollbarStrokeWidth; // When hovered, the thumb takes up the full width. Otherwise, it's a bit // slimmer. -const int kThumbHoverOffset = 4; -const int kThumbStroke = 1; -const float kThumbHoverAlpha = 0.5f; -const float kThumbDefaultAlpha = 0.3f; +constexpr int kThumbHoverOffset = 4; +// The layout size of the thumb stroke, in DIP. +constexpr int kThumbStroke = ui::kOverlayScrollbarStrokeWidth; +// The visual size of the thumb stroke, in px. +constexpr int kThumbStrokeVisualSize = ui::kOverlayScrollbarStrokeWidth; } // namespace @@ -65,11 +68,20 @@ cc::PaintFlags stroke_flags; stroke_flags.setStyle(cc::PaintFlags::kStroke_Style); - stroke_flags.setColor(SK_ColorWHITE); - stroke_flags.setStrokeWidth(kThumbStroke); + stroke_flags.setColor( + SkColorSetA(SK_ColorWHITE, (ui::kOverlayScrollbarStrokeNormalAlpha / + ui::kOverlayScrollbarThumbNormalAlpha) * + SK_AlphaOPAQUE)); + stroke_flags.setStrokeWidth(kThumbStrokeVisualSize); stroke_flags.setStrokeCap(cc::PaintFlags::kSquare_Cap); + + // The stroke is a single pixel, so we must deal with the unscaled canvas. + const float dsf = canvas->UndoDeviceScaleFactor(); gfx::RectF stroke_bounds(fill_bounds); - stroke_bounds.Inset(gfx::InsetsF(kThumbStroke / 2.f)); + stroke_bounds.Scale(dsf); + // The stroke should be aligned to the pixel center that is nearest the fill, + // so outset by a half pixel. + stroke_bounds.Inset(gfx::InsetsF(-kThumbStrokeVisualSize / 2.0f)); // The stroke doesn't apply to the far edge of the thumb. SkPath path; path.moveTo(gfx::PointFToSkPoint(stroke_bounds.top_right())); @@ -99,13 +111,13 @@ gfx::Vector2d(IsHorizontal() ? 0 : kThumbHoverOffset, IsHorizontal() ? kThumbHoverOffset: 0)); layer()->SetTransform(translation); - layer()->SetOpacity(kThumbDefaultAlpha); + layer()->SetOpacity(ui::kOverlayScrollbarThumbNormalAlpha); if (GetWidget()) scroll_bar_->StartHideCountdown(); } else { layer()->SetTransform(gfx::Transform()); - layer()->SetOpacity(kThumbHoverAlpha); + layer()->SetOpacity(ui::kOverlayScrollbarThumbHoverAlpha); } } @@ -166,7 +178,7 @@ void OverlayScrollBar::Hide() { ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator()); - settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(200)); + settings.SetTransitionDuration(ui::kOverlayScrollbarFadeOutDuration); layer()->SetOpacity(0.0f); } @@ -174,7 +186,7 @@ if (IsMouseHovered()) return; hide_timer_.Start( - FROM_HERE, base::TimeDelta::FromSeconds(1), + FROM_HERE, ui::kOverlayScrollbarFadeOutDelay, base::Bind(&OverlayScrollBar::Hide, base::Unretained(this))); }
diff --git a/ui/views/mus/BUILD.gn b/ui/views/mus/BUILD.gn index 0c46f41..fa5e745 100644 --- a/ui/views/mus/BUILD.gn +++ b/ui/views/mus/BUILD.gn
@@ -136,6 +136,10 @@ "//ui/views:test_support_internal", ] + if (use_ozone) { + deps += [ "//ui/ozone" ] + } + data_deps = [ ":views_mus_tests_catalog", "//ui/resources:ui_test_pak_data",
diff --git a/ui/views/mus/mus_client.cc b/ui/views/mus/mus_client.cc index 136424b6..b3083c34 100644 --- a/ui/views/mus/mus_client.cc +++ b/ui/views/mus/mus_client.cc
@@ -33,6 +33,10 @@ #include "ui/wm/core/shadow_types.h" #include "ui/wm/core/wm_state.h" +#if defined(USE_OZONE) +#include "ui/base/cursor/ozone/cursor_data_factory_ozone.h" +#endif + // Widget::InitParams::Type must match that of ui::mojom::WindowType. #define WINDOW_TYPES_MATCH(NAME) \ static_assert( \ @@ -67,6 +71,16 @@ DCHECK(aura::Env::GetInstance()); instance_ = this; +#if defined(USE_OZONE) + // If we're in a mus client, we aren't going to have all of ozone initialized + // even though we're in an ozone build. All the hard coded USE_OZONE ifdefs + // that handle cursor code expect that there will be a CursorFactoryOzone + // instance. Partially initialize the ozone cursor internals here, like we + // partially initialize other ozone subsystems in + // ChromeBrowserMainExtraPartsViews. + cursor_factory_ozone_ = base::MakeUnique<ui::CursorDataFactoryOzone>(); +#endif + if (!io_task_runner) { io_thread_ = base::MakeUnique<base::Thread>("IOThread"); base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
diff --git a/ui/views/mus/mus_client.h b/ui/views/mus/mus_client.h index 3469b3e..ca23593 100644 --- a/ui/views/mus/mus_client.h +++ b/ui/views/mus/mus_client.h
@@ -35,6 +35,10 @@ class Connector; } +namespace ui { +class CursorDataFactoryOzone; +} + namespace wm { class WMState; } @@ -152,6 +156,10 @@ base::ObserverList<MusClientObserver> observer_list_; +#if defined(USE_OZONE) + std::unique_ptr<ui::CursorDataFactoryOzone> cursor_factory_ozone_; +#endif + // NOTE: this may be null (creation is based on argument supplied to // constructor). std::unique_ptr<wm::WMState> wm_state_;
diff --git a/ui/views/view.cc b/ui/views/view.cc index 83192d8..6b231e9b 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc
@@ -1552,19 +1552,15 @@ } void View::OnPaintBackground(gfx::Canvas* canvas) { - if (background_.get()) { - TRACE_EVENT2("views", "View::OnPaintBackground", - "width", canvas->sk_canvas()->getBaseLayerSize().width(), - "height", canvas->sk_canvas()->getBaseLayerSize().height()); + if (background_) { + TRACE_EVENT0("views", "View::OnPaintBackground"); background_->Paint(canvas, this); } } void View::OnPaintBorder(gfx::Canvas* canvas) { - if (border_.get()) { - TRACE_EVENT2("views", "View::OnPaintBorder", - "width", canvas->sk_canvas()->getBaseLayerSize().width(), - "height", canvas->sk_canvas()->getBaseLayerSize().height()); + if (border_) { + TRACE_EVENT0("views", "View::OnPaintBorder"); border_->Paint(*this, canvas); } }
diff --git a/url/url_canon_mailtourl.cc b/url/url_canon_mailtourl.cc index fb6bc9a..8a7ff1ae 100644 --- a/url/url_canon_mailtourl.cc +++ b/url/url_canon_mailtourl.cc
@@ -13,6 +13,23 @@ namespace { +// Certain characters should be percent-encoded when they appear in the path +// component of a mailto URL, to improve compatibility and mitigate against +// command-injection attacks on mailto handlers. See https://crbug.com/711020. +template <typename UCHAR> +bool ShouldEncodeMailboxCharacter(UCHAR uch) { + if (uch < 0x21 || // space & control characters. + uch > 0x7e || // high-ascii characters. + uch == 0x22 || // quote. + uch == 0x3c || uch == 0x3e || // angle brackets. + uch == 0x60 || // backtick. + uch == 0x7b || uch == 0x7c || uch == 0x7d // braces and pipe. + ) { + return true; + } + return false; +} + template <typename CHAR, typename UCHAR> bool DoCanonicalizeMailtoURL(const URLComponentSource<CHAR>& source, const Parsed& parsed, @@ -38,12 +55,12 @@ new_parsed->path.begin = output->length(); // Copy the path using path URL's more lax escaping rules. - // We convert to UTF-8 and escape non-ASCII, but leave all + // We convert to UTF-8 and escape non-ASCII, but leave most // ASCII characters alone. int end = parsed.path.end(); for (int i = parsed.path.begin; i < end; ++i) { UCHAR uch = static_cast<UCHAR>(source.path[i]); - if (uch < 0x20 || uch >= 0x80) + if (ShouldEncodeMailboxCharacter<UCHAR>(uch)) success &= AppendUTF8EscapedChar(source.path, &i, end, output); else output->push_back(static_cast<char>(uch));
diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc index 8ac73bc..9ca51aa 100644 --- a/url/url_canon_unittest.cc +++ b/url/url_canon_unittest.cc
@@ -1847,20 +1847,51 @@ Component expected_path; Component expected_query; } cases[] = { - {"mailto:addr1", "mailto:addr1", true, Component(7, 5), Component()}, - {"mailto:addr1@foo.com", "mailto:addr1@foo.com", true, Component(7, 13), Component()}, + // Null character should be escaped to %00. + // Keep this test first in the list as it is handled specially below. + {"mailto:addr1\0addr2?foo", + "mailto:addr1%00addr2?foo", + true, Component(7, 13), Component(21, 3)}, + {"mailto:addr1", + "mailto:addr1", + true, Component(7, 5), Component()}, + {"mailto:addr1@foo.com", + "mailto:addr1@foo.com", + true, Component(7, 13), Component()}, // Trailing whitespace is stripped. - {"MaIlTo:addr1 \t ", "mailto:addr1", true, Component(7, 5), Component()}, - {"MaIlTo:addr1?to=jon", "mailto:addr1?to=jon", true, Component(7, 5), Component(13,6)}, - {"mailto:addr1,addr2", "mailto:addr1,addr2", true, Component(7, 11), Component()}, - {"mailto:addr1, addr2", "mailto:addr1, addr2", true, Component(7, 12), Component()}, - {"mailto:addr1%2caddr2", "mailto:addr1%2caddr2", true, Component(7, 13), Component()}, - {"mailto:\xF0\x90\x8C\x80", "mailto:%F0%90%8C%80", true, Component(7, 12), Component()}, - // Null character should be escaped to %00 - {"mailto:addr1\0addr2?foo", "mailto:addr1%00addr2?foo", true, Component(7, 13), Component(21, 3)}, + {"MaIlTo:addr1 \t ", + "mailto:addr1", + true, Component(7, 5), Component()}, + {"MaIlTo:addr1?to=jon", + "mailto:addr1?to=jon", + true, Component(7, 5), Component(13,6)}, + {"mailto:addr1,addr2", + "mailto:addr1,addr2", + true, Component(7, 11), Component()}, + // Embedded spaces must be encoded. + {"mailto:addr1, addr2", + "mailto:addr1,%20addr2", + true, Component(7, 14), Component()}, + {"mailto:addr1, addr2?subject=one two ", + "mailto:addr1,%20addr2?subject=one%20two", + true, Component(7, 14), Component(22, 17)}, + {"mailto:addr1%2caddr2", + "mailto:addr1%2caddr2", + true, Component(7, 13), Component()}, + {"mailto:\xF0\x90\x8C\x80", + "mailto:%F0%90%8C%80", + true, Component(7, 12), Component()}, // Invalid -- UTF-8 encoded surrogate value. - {"mailto:\xed\xa0\x80", "mailto:%EF%BF%BD", false, Component(7, 9), Component()}, - {"mailto:addr1?", "mailto:addr1?", true, Component(7, 5), Component(13, 0)}, + {"mailto:\xed\xa0\x80", + "mailto:%EF%BF%BD", + false, Component(7, 9), Component()}, + {"mailto:addr1?", + "mailto:addr1?", + true, Component(7, 5), Component(13, 0)}, + // Certain characters have special meanings and must be encoded. + {"mailto:! \x22$&()+,-./09:;<=>@AZ[\\]&_`az{|}~\x7f?Query! \x22$&()+,-./09:;<=>@AZ[\\]&_`az{|}~", + "mailto:!%20%22$&()+,-./09:;%3C=%3E@AZ[\\]&_%60az%7B%7C%7D~%7F?Query!%20%22$&()+,-./09:;%3C=%3E@AZ[\\]&_`az{|}~", + true, Component(7, 53), Component(61, 47)}, }; // Define outside of loop to catch bugs where components aren't reset @@ -1869,8 +1900,8 @@ for (size_t i = 0; i < arraysize(cases); i++) { int url_len = static_cast<int>(strlen(cases[i].input)); - if (i == 8) { - // The 9th test case purposely has a '\0' in it -- don't count it + if (i == 0) { + // The first test case purposely has a '\0' in it -- don't count it // as the string terminator. url_len = 22; }