Commit ad92aa35 authored by andybons's avatar andybons Committed by Commit bot

[Docs] Another round of stylistic fixes.

TBR=nodir
BUG=524256

Review URL: https://codereview.chromium.org/1324603002

Cr-Commit-Position: refs/heads/master@{#346335}
parent 22afb318
jparent@chromium.org
nodir@chromium.org
andybons@chromium.org
*
# Benefits of ViewsGtk
# Gtk vs ViewsGtk
* Better code sharing. For example, don't have to duplicate tab layout or bookmark bar layout code.
* Tab Strip
* Drawing
* All the animationy bits
* Subtle click selection behavior (curved corners)
* Drag behavior, including dropping of files onto the URL bar
* Closing behavior
* Bookmarks bar
* drag & drop behavior, including menus
* chevron?
* Easier for folks to work on both platforms without knowing much about the underlying toolkits.
* Don't have to implement ui features twice.
## Benefits of ViewsGtk
* Better code sharing. For example, don't have to duplicate tab layout or
bookmark bar layout code.
* Tab Strip
* Drawing
* All the animationy bits
* Subtle click selection behavior (curved corners)
* Drag behavior, including dropping of files onto the URL bar
* Closing behavior
* Bookmarks bar
* drag & drop behavior, including menus
* chevron?
* Easier for folks to work on both platforms without knowing much about the
underlying toolkits.
* Don't have to implement ui features twice.
# Benefits of Gtk
* Dialogs
* Native feel layout
* Font size changes (e.g., changing the system font size will apply to our dialogs)
* Better RTL (e.g., http://crbug.com/2822 http://crbug.com/5729 http://crbug.com/6082 http://crbug.com/6103 http://crbug.com/6125 http://crbug.com/8686 http://crbug.com/8649 )
* Being able to obey the user's system theme
* Accessibility for buttons and dialogs (but not for tabstrip and bookmarks)
* A better change at good remote X performance?
* We still would currently need Pango / Cairo for text layout, so it will be more efficient to just draw that during the Gtk pipeline instead of with Skia.
* Gtk widgets will automatically "feel and behave" like Linux. The behavior of our own Views system does not necessarily feel right on Linux.
* People working on Windows features don't need to worry about breaking the Linux build.
\ No newline at end of file
## Benefits of Gtk
* Dialogs
* Native feel layout
* Font size changes (e.g., changing the system font size will apply to our
dialogs)
* Better RTL (e.g., http://crbug.com/2822 http://crbug.com/5729
http://crbug.com/6082 http://crbug.com/6103 http://crbug.com/6125
http://crbug.com/8686 http://crbug.com/8649)
* Being able to obey the user's system theme
* Accessibility for buttons and dialogs (but not for tabstrip and bookmarks)
* A better change at good remote X performance?
* We still would currently need Pango / Cairo for text layout, so it will be
more efficient to just draw that during the Gtk pipeline instead of with
Skia.
* Gtk widgets will automatically "feel and behave" like Linux. The behavior of
our own Views system does not necessarily feel right on Linux.
* People working on Windows features don't need to worry about breaking the
Linux build.
This diff is collapsed.
# Introduction
**WARNING:** This is all very alpha. Proceed at your own risk. The Mac instructions are very out of date -- IWYU currently isn't generally usable, so we stopped looking at it for chromium.
See [include what you use page](http://code.google.com/p/include-what-you-use/) for background about what it is and why it is important.
This page describes running IWYU for Chromium.
# Linux/Blink
## Running IWYU
These instructions have a slightly awkward workflow. Ideally we should use something like `CXX=include-what-you-use GYP_DEFINES="clang=1" gclient runhooks; ninja -C out/Debug webkit -k 10000` if someone can get it working.
* Install include-what-you-use (see [here](https://code.google.com/p/include-what-you-use/wiki/InstructionsForUsers)). Make sure to use --enable-optimized=YES when building otherwise IWYU will be very slow.
* Get the compilation commands from ninja (using g++), and derive include-what-you-use invocations from it
```
$ cd /path/to/chromium/src
$ ninja -C out/Debug content_shell -v > ninjalog.txt
$ sed '/obj\/third_party\/WebKit\/Source/!d; s/^\[[0-9\/]*\] //; /^g++/!d; s/^g++/include-what-you-use -Wno-c++11-extensions/; s/-fno-ident//' ninjalog.txt > commands.txt
```
* Run the IWYU commands. We do this in parallel for speed. Merge the output and remove any complaints that the compiler has.
```
$ cd out/Debug
$ for i in {1..32}; do (sed -ne "$i~32p" ../../commands.txt | xargs -n 1 -L 1 -d '\n' bash -c > iwyu_$i.txt 2>&1) & done
$ cat iwyu_{1..32}.txt | sed '/In file included from/d;/\(note\|warning\|error\):/{:a;N;/should add/!b a;s/.*\n//}' > iwyu.txt
$ rm iwyu_{1..32}.txt
```
* The output in iwyu.txt has all the suggested changes
# Mac
## Setup
1. Checkout and build IWYU (This will also check out and build clang. See [Clang page](http://code.google.com/p/chromium/wiki/Clang) for details.)
```
$ cd /path/to/src/
$ tools/clang/scripts/update_iwyu.sh
```
1. Ensure "Continue building after errors" is enabled in the Xcode Preferences UI.
## Chromium
1. Build Chromium. Be sure to substitute in the correct absolute path for `/path/to/src/`.
```
$ GYP_DEFINES='clang=1' gclient runhooks
$ cd chrome
$ xcodebuild -configuration Release -target chrome OBJROOT=/path/to/src/clang/obj DSTROOT=/path/to/src/clang SYMROOT=/path/to/src/clang CC=/path/to/src/third_party/llvm-build/Release+Asserts/bin/clang++
```
1. Run IWYU. Be sure to substitute in the correct absolute path for `/path/to/src/`.
```
$ xcodebuild -configuration Release -target chrome OBJROOT=/path/to/src/clang/obj DSTROOT=/path/to/src/clang SYMROOT=/path/to/src/clang CC=/path/to/src/third_party/llvm-build/Release+Asserts/bin/include-what-you-use
```
## WebKit
1. Build TestShell. Be sure to substitute in the correct absolute path for `/path/to/src/`.
```
$ GYP_DEFINES='clang=1' gclient runhooks
$ cd webkit
$ xcodebuild -configuration Release -target test_shell OBJROOT=/path/to/src/clang/obj DSTROOT=/path/to/src/clang SYMROOT=/path/to/src/clang CC=/path/to/src/third_party/llvm-build/Release+Asserts/bin/clang++
```
1. Run IWYU. Be sure to substitute in the correct absolute path for `/path/to/src/`.
```
$ xcodebuild -configuration Release -target test_shell OBJROOT=/path/to/src/clang/obj DSTROOT=/path/to/src/clang SYMROOT=/path/to/src/clang CC=/work/chromium/src/third_party/llvm-build/Release+Asserts/bin/include-what-you-use
```
# Bragging
You can run `tools/include_tracer.py` to get header file sizes before and after running iwyu. You can then include stats like "This reduces the size of foo.h from 2MB to 80kB" in your CL descriptions.
# Known Issues
We are a long way off from being able to accept the results of IWYU for Chromium/Blink. However, even in its current state it can be a useful tool for finding forward declaration opportunities and unused includes.
Using IWYU with Blink has several issues:
* Lack of understanding on Blink style, e.g. config.h, wtf/MathExtras.h, wtf/Forward.h, wtf/Threading.h
* "using" declarations (most of WTF) makes IWYU not suggest forward declarations
* Functions defined inline in a different location to the declaration are dropped, e.g. Document::renderView in RenderView.h and Node::renderStyle in NodeRenderStyle.h
* typedefs can cause unwanted dependencies, e.g. typedef int ExceptionCode in Document.h
* .cpp files don't always correspond directly to .h files, e.g. Foo.h can be implemented in e.g. chromium/FooChromium.cpp
* g++/clang/iwyu seems fine with using forward declarations for PassRefPtr types in some circumstances, which MSVC doesn't.
\ No newline at end of file
#How to install Chromium OS on VMWare
# How to install Chromium OS on VMWare
# Download
## Download
1.[Download VMware player](http://www.vmware.com/products/player/)
<br>2.<a href='http://gdgt.com/google/chrome-os/download/'>Create gtgt.com account and download Chrome image</a>
1. [Download VMware player](http://www.vmware.com/products/player/)
2. [Create a gtgt.com account and download Chrome image](http://gdgt.com/google/chrome-os/download/)
<h1>Mounting</h1>
## Mounting
1. Create a New Virtual Machine<br>
<br>2. Do not selecting any OP-sys (other-other-etc)<br>
<br>3. Delete your newly created hardisc (lets say you named it as Chrome)<br>
<br>4. Move downloaded harddisc to the same folder as othere VMware files for this Virtual Machine<br>
<br>5. Rename your downloaded hardisc to newly created Virtual Machine original name (in my example it was Chrome)<br>
<br>6. Boot the Chrome Virtual Machine (recommended to use NAT network configuration)<br>
<br>
<h1>Google results</h1>
1. Create a New Virtual Machine
1. Do not selecting any OP-sys (other-other-etc)
1. Delete your newly created hardisc (lets say you named it as Chrome)
1. Move downloaded harddisc to the same folder as othere VMware files for this
Virtual Machine
1. Rename your downloaded hardisc to newly created Virtual Machine original
name (in my example it was Chrome)
1. Boot the Chrome Virtual Machine (recommended to use NAT network
configuration)
> <a href='http://discuss.gdgt.com/google/chrome-os/general/download-chrome-os-vmware-image/'>http://discuss.gdgt.com/google/chrome-os/general/download-chrome-os-vmware-image/</a>
<br>> <a href='http://www.engadget.com/2009/11/20/google-chrome-os-available-as-free-vmware-download/'>http://www.engadget.com/2009/11/20/google-chrome-os-available-as-free-vmware-download/</a>
<br>> <a href='http://blogs.zdnet.com/gadgetreviews/?p=9583'>http://blogs.zdnet.com/gadgetreviews/?p=9583</a>
\ No newline at end of file
## Google results
* http://discuss.gdgt.com/google/chrome-os/general/download-chrome-os-vmware-image/
* http://www.engadget.com/2009/11/20/google-chrome-os-available-as-free-vmware-download/
* http://blogs.zdnet.com/gadgetreviews/?p=9583'>http://blogs.zdnet.com/gadgetreviews/?p=9583
#Come installare Chromium OS su VMWare
# Come installare Chromium OS su VMWare
# Download
## Download
1.[Scarica VMware player](http://www.vmware.com/products/player/)
<br>2.<a href='http://gdgt.com/google/chrome-os/download/'>Crea un account su gtgt.com account e scarica l'immagine di Chrome</a>
1. [Scarica VMware player](http://www.vmware.com/products/player/)
2. [Crea un account su gtgt.com account e scarica l'immagine di Chrome](http://gdgt.com/google/chrome-os/download/)
<h1>Montare l'Immagine</h1>
## Montare l'Immagine
1. Crea una nuova Virtual Machine<br>
<br>2. Non selezionare nessun sistema operativo (other-other-ecc)<br>
<br>3. Elimina l'hard disk virtuale appena creato (se hai nominato la virtual machine "Chrome", elimina il file "Chrome.vmdk" )<br>
<br>4. Sposta l'immagine dell'Hard Disk scaricato nella stessa cartella dove vi sono gli altri files di VMware per questa virtual machine<br>
<br>5. Rinomina l'immagine dell'Hard Disk scaricato con il nome della Virtual Machine creata (nel mio esempio è Chrome)<br>
<br>6. Avvia la Virtual Machine (si consiglia di usare la configurazione di rete NAT)<br>
<h1>Risultati di Google</h1>
1. Crea una nuova Virtual Machine
1. Non selezionare nessun sistema operativo (other-other-ecc)
1. Elimina l'hard disk virtuale appena creato (se hai nominato la virtual
machine "Chrome", elimina il 1i le "Chrome.vmdk" )
1. Sposta l'immagine dell'Hard Disk scaricato nella stessa cartella dove vi
sono gli altri files di 1M ware per questa virtual machine
1. Rinomina l'immagine dell'Hard Disk scaricato con il nome della Virtual
Machine creata (nel mio 1s empio è Chrome)
1. Avvia la Virtual Machine (si consiglia di usare la configurazione di rete
NAT)
> <a href='http://discuss.gdgt.com/google/chrome-os/general/download-chrome-os-vmware-image/'>http://discuss.gdgt.com/google/chrome-os/general/download-chrome-os-vmware-image/</a>
<br>> <a href='http://www.engadget.com/2009/11/20/google-chrome-os-available-as-free-vmware-download/'>http://www.engadget.com/2009/11/20/google-chrome-os-available-as-free-vmware-download/</a>
<br>> <a href='http://blogs.zdnet.com/gadgetreviews/?p=9583'>http://blogs.zdnet.com/gadgetreviews/?p=9583</a>
## Risultati di Google
* http://discuss.gdgt.com/google/chrome-os/general/download-chrome-os-vmware-image/
* http://www.engadget.com/2009/11/20/google-chrome-os-available-as-free-vmware-download/
* http://blogs.zdnet.com/gadgetreviews/?p=9583'>http://blogs.zdnet.com/gadgetreviews/?p=9583
# Introduction
# IPC Fuzzer
A chromium IPC fuzzer is under development by aedla and tsepez. The fuzzer lives under `src/tools/ipc_fuzzer/` and is running on ClusterFuzz. A previous version of the fuzzer was a simple bitflipper, which caught around 10 bugs. A new version is doing smarter mutations and generational fuzzing. To do so, each `ParamTraits<Type>` needs a corresponding `FuzzTraits<Type>`. Feel free to contribute.
A chromium IPC fuzzer is under development by aedla and tsepez. The fuzzer lives
under `src/tools/ipc_fuzzer/` and is running on ClusterFuzz. A previous version
of the fuzzer was a simple bitflipper, which caught around 10 bugs. A new
version is doing smarter mutations and generational fuzzing. To do so, each
`ParamTraits<Type>` needs a corresponding `FuzzTraits<Type>`. Feel free to
contribute.
[TOC]
---
## Working with the fuzzer
# Working with the fuzzer
### Build instructions
## Build instructions
* add `enable_ipc_fuzzer=1` to `GYP_DEFINES`
* build `ipc_fuzzer_all` target
* component builds are currently broken, sorry
* Debug builds are broken; only Release mode works.
* add `enable_ipc_fuzzer=1` to `GYP_DEFINES`
* build `ipc_fuzzer_all` target
* component builds are currently broken, sorry
* Debug builds are broken; only Release mode works.
## Replaying ipcdumps
* `tools/ipc_fuzzer/scripts/play_testcase.py path/to/testcase.ipcdump`
* more help: `tools/ipc_fuzzer/scripts/play_testcase.py -h`
### Replaying ipcdumps
## Listing messages in ipcdump
* `out/`_Build_`/ipc_message_util --dump path/to/testcase.ipcdump`
* `tools/ipc_fuzzer/scripts/play_testcase.py path/to/testcase.ipcdump`
* more help: `tools/ipc_fuzzer/scripts/play_testcase.py -h`
## Updating fuzzers in ClusterFuzz
* `tools/ipc_fuzzer/scripts/cf_package_builder.py`
* upload `ipc_fuzzer_mut.zip` and `ipc_fuzzer_gen.zip` under build directory to ClusterFuzz
### Listing messages in ipcdump
## Contributing FuzzTraits
* add them to tools/ipc\_fuzzer/fuzzer/fuzzer.cc
* thanks!
* `out/<Build>/ipc_message_util --dump path/to/testcase.ipcdump`
### Updating fuzzers in ClusterFuzz
---
* `tools/ipc_fuzzer/scripts/cf_package_builder.py`
* upload `ipc_fuzzer_mut.zip` and `ipc_fuzzer_gen.zip` under build directory
to ClusterFuzz
# Components
### Contributing FuzzTraits
## ipcdump logger
* add `enable_ipc_fuzzer=1` to `GYP_DEFINES`
* build `chrome` and `ipc_message_dump` targets
* run chrome with `--no-sandbox --ipc-dump-directory=/path/to/ipcdump/directory`
* ipcdumps will be created in this directory for each renderer using the format _pid_.ipcdump
* add them to `tools/ipc_fuzzer/fuzzer/fuzzer.cc`
* thanks!
## ipcdump replay
Lives under `ipc_fuzzer/replay`. The renderer is replaced with `ipc_fuzzer_replay` using `--renderer-cmd-prefix`. This is done automatically with the `ipc_fuzzer/play_testcase.py` convenience script.
## Components
## ipcdump mutator / generator
Lives under `ipc_fuzzer/fuzzer`. This is the code that runs on ClusterFuzz. It uses `FuzzTraits<Type>` to mutate ipcdumps or generate them out of thin air.
### ipcdump logger
* add `enable_ipc_fuzzer=1` to `GYP_DEFINES`
* build `chrome` and `ipc_message_dump` targets
* run chrome with
`--no-sandbox --ipc-dump-directory=/path/to/ipcdump/directory`
* ipcdumps will be created in this directory for each renderer using the
format `_pid_.ipcdump`
---
### ipcdump replay
# Problems, questions, suggestions
Send them to mbarbella@chromium.org.
\ No newline at end of file
Lives under `ipc_fuzzer/replay`. The renderer is replaced with
`ipc_fuzzer_replay` using `--renderer-cmd-prefix`. This is done automatically
with the `ipc_fuzzer/play_testcase.py` convenience script.
### ipcdump mutator / generator
Lives under `ipc_fuzzer/fuzzer`. This is the code that runs on ClusterFuzz. It
uses `FuzzTraits<Type>` to mutate ipcdumps or generate them out of thin air.
## Problems, questions, suggestions
Send them to mbarbella@chromium.org.
## Introduction
If you have a real world kiosk application that you want to run on Google Chrome, then below are the steps to take to simulate kiosk mode.
# Kiosk Mode
If you have a real world kiosk application that you want to run on Google
Chrome, then below are the steps to take to simulate kiosk mode.
## Steps to Simulate Kiosk Mode
......@@ -9,7 +9,7 @@ If you have a real world kiosk application that you want to run on Google Chrome
Compile the following Java code:
```
```java
import java.awt.*;
import java.applet.*;
import java.security.*;
......@@ -21,9 +21,9 @@ public class FullScreen extends Applet
{
AccessController.doPrivileged
(
new PrivilegedAction()
new PrivilegedAction()
{
public Object run()
public Object run()
{
try
{
......@@ -46,8 +46,11 @@ public class FullScreen extends Applet
Include it in an applet on your kiosk application's home page:
```
<applet name="appletFullScreen" code="FullScreen.class" width="1" height="1"></applet>
```html
<applet name="appletFullScreen"
code="FullScreen.class"
width="1"
height="1"></applet>
```
### Step 3
......@@ -56,16 +59,17 @@ Add the following to the kiosk computer's java.policy file:
```
grant codeBase "http://yourservername/*"
{
{
permission java.security.AllPermission;
};
```
### Step 4
Include the following JavaScript and assign the doLoad function to the onload event:
Include the following JavaScript and assign the `doLoad` function to the
`onload` event:
```
```javascript
var _appletFullScreen;
function doLoad()
......@@ -78,8 +82,9 @@ function doFullScreen()
{
if (_appletFullScreen && _appletFullScreen.fullScreen)
{
// Add an if statement to check whether document.body.clientHeight is not indicative of full screen mode
// Add an if statement to check whether document.body.clientHeight is not
// indicative of full screen mode
_appletFullScreen.fullScreen();
}
}
```
\ No newline at end of file
```
# Running layout tests on Linux
1. Build `blink_tests` (see LinuxBuildInstructions)
1. Checkout the layout tests
* If you have an entry in your .gclient file that includes "LayoutTests", you may need to comment it out and sync.
* You can run a subset of the tests by passing in a path relative to `src/third_party/WebKit/LayoutTests/`. For example, `run_layout_tests.py fast` will only run the tests under `src/third_party/WebKit/LayoutTests/fast/`.
1. When the tests finish, any unexpected results should be displayed.
See [Running WebKit Layout Tests](http://dev.chromium.org/developers/testing/webkit-layout-tests) for full documentation about set up and available options.
1. Build `blink_tests` (see LinuxBuildInstructions)
1. Checkout the layout tests
* If you have an entry in your `.gclient` file that includes
"LayoutTests", you may need to comment it out and sync.
* You can run a subset of the tests by passing in a path relative to
`src/third_party/WebKit/LayoutTests/`. For example,
`run_layout_tests.py fast` will only run the tests under
`src/third_party/WebKit/LayoutTests/fast/`.
1. When the tests finish, any unexpected results should be displayed.
See
[Running WebKit Layout Tests](http://dev.chromium.org/developers/testing/webkit-layout-tests)
for full documentation about set up and available options.
## Pixel Tests
The pixel test results were generated on Ubuntu 10.4 (Lucid). If you're running a newer version of Ubuntu, you will get some pixel test failures due to changes in freetype or fonts. In this case, you can create a Lucid 64 chroot using `build/install-chroot.sh` to compile and run tests.
The pixel test results were generated on Ubuntu 10.4 (Lucid). If you're running
a newer version of Ubuntu, you will get some pixel test failures due to changes
in freetype or fonts. In this case, you can create a Lucid 64 chroot using
`build/install-chroot.sh` to compile and run tests.
## Fonts
Make sure you have all the necessary fonts installed.
```
```shell
sudo apt-get install apache2 wdiff php5-cgi ttf-indic-fonts \
msttcorefonts ttf-dejavu-core ttf-kochi-gothic ttf-kochi-mincho \
ttf-thai-tlwg
......@@ -25,66 +35,104 @@ You can also just run `build/install-build-deps.sh` again.
## Plugins
If `fast/dom/object-plugin-hides-properties.html` and `plugins/embed-attributes-style.html` are failing, try uninstalling `totem-mozilla` from your system:
```
sudo apt-get remove totem-mozilla
```
If `fast/dom/object-plugin-hides-properties.html` and
`plugins/embed-attributes-style.html` are failing, try uninstalling
`totem-mozilla` from your system:
sudo apt-get remove totem-mozilla
## Running layout tests under valgrind on Linux
As above, but use `tools/valgrind/chrome_tests.sh -t webkit` instead. e.g.
```
sh tools/valgrind/chrome_tests.sh -t webkit LayoutTests/fast/
```
sh tools/valgrind/chrome_tests.sh -t webkit LayoutTests/fast/
This defaults to using --debug. Read the script for more details.
If you're trying to reproduce a run from the valgrind buildbot, look for the --run\_chunk=XX:YY
line in the bot's log. You can rerun exactly as the bot did with the commands
```
If you're trying to reproduce a run from the valgrind buildbot, look for the
`--run_chunk=XX:YY` line in the bot's log. You can rerun exactly as the bot did
with the commands.
```shell
cd ~/chromium/src
echo XX > valgrind_layout_chunk.txt
echo XX > valgrind_layout_chunk.txt
sh tools/valgrind/chrome_tests.sh -t layout -n YY
```
That will run the XXth chunk of YY layout tests.
## Configuration tips
* Use an optimized content\_shell when rebaselining or running a lot of tests. ([bug 8475](http://code.google.com/p/chromium/issues/detail?id=8475) is about how the debug output differs from the optimized output.) `ninja -C out/Release content_shell`
* Make sure you have wdiff installed: `sudo apt-get install wdiff` to get prettier diff output
* Some pixel tests may fail due to processor-specific rounding errors. Build using a chroot jail with Lucid 64-bit user space to be sure that your system matches the checked in baselines. You can use `build/install-chroot.sh` to set up a Lucid 64 chroot. Learn more about [UsingALinuxChroot](UsingALinuxChroot.md).
* Use an optimized `content_shell` when rebaselining or running a lot of
tests. ([bug 8475](https://crbug.com/8475) is about how the debug output
differs from the optimized output.)
`ninja -C out/Release content_shell`
* Make sure you have wdiff installed: `sudo apt-get install wdiff` to get
prettier diff output.
* Some pixel tests may fail due to processor-specific rounding errors. Build
using a chroot jail with Lucid 64-bit user space to be sure that your system
matches the checked in baselines. You can use `build/install-chroot.sh` to
set up a Lucid 64 chroot. Learn more about
[using a linux chroot](using_a_linux_chroot.md).
## Getting a layout test into a debugger
There are two ways:
1. Run content\_shell directly rather than using run\_layout\_tests.py. You will need to pass some options:
* `--no-timeout` to give you plenty of time to debug
* the fully qualified path of the layout test (rather than relative to `WebKit/LayoutTests`).
1. Or, run as normal but with the `--additional-drt-flag=--renderer-startup-dialog --additional-drt-flag=--no-timeout --time-out-ms=86400000` flags. The first one makes content\_shell bring up a dialog before running, which then would let you attach to the process via `gdb -p PID_OF_DUMPRENDERTREE`. The others help avoid the test shell and DumpRenderTree timeouts during the debug session.
1. Run `content_shell` directly rather than using `run_layout_tests.py`. You
will need to pass some options:
* `--no-timeout` to give you plenty of time to debug
* the fully qualified path of the layout test (rather than relative to
`WebKit/LayoutTests`).
1. Or, run as normal but with the
`--additional-drt-flag=--renderer-startup-dialog
--additional-drt-flag=--no-timeout --time-out-ms=86400000` flags. The first
one makes content\_shell bring up a dialog before running, which then would
let you attach to the process via `gdb -p PID_OF_DUMPRENDERTREE`. The others
help avoid the test shell and DumpRenderTree timeouts during the debug
session.
## Using an embedded X server
If you try to use your computer while the tests are running, you may get annoyed as windows are opened and closed automatically. To get around this, you can create a separate X server for running the tests.
If you try to use your computer while the tests are running, you may get annoyed
as windows are opened and closed automatically. To get around this, you can
create a separate X server for running the tests.
1. Install Xephyr (`sudo apt-get install xserver-xephyr`)
1. Start Xephyr as display 4: `Xephyr :4 -screen 1024x768x24`
1. Run the layout tests in the Xephyr: `DISPLAY=:4 run_layout_tests.py`
Xephyr supports debugging repainting. See the
[Xephyr README](http://cgit.freedesktop.org/xorg/xserver/tree/hw/kdrive/ephyr/README)
for details. In brief:
1. Install Xephyr (`sudo apt-get install xserver-xephyr`)
1. Start Xephyr as display 4: `Xephyr :4 -screen 1024x768x24`
1. Run the layout tests in the Xephyr: `DISPLAY=:4 run_layout_tests.py`
1. `XEPHYR_PAUSE=$((500*1000)) Xephyr ...etc... # 500 ms repaint flash`
1. `kill -USR1 $(pidof Xephyr)`
Xephyr supports debugging repainting. See the [Xephyr README](http://cgit.freedesktop.org/xorg/xserver/tree/hw/kdrive/ephyr/README) for details. In brief:
1. `XEPHYR_PAUSE=$((500*1000)) Xephyr ...etc... # 500 ms repaint flash`
1. `kill -USR1 $(pidof Xephyr)`
If you don't want to see anything at all, you can use Xvfb (should already be
installed).
If you don't want to see anything at all, you can use Xvfb (should already be installed).
1. Start Xvfb as display 4: `Xvfb :4 -screen 0 1024x768x24`
1. Run the layout tests in the Xvfb: `DISPLAY=:4 run_layout_tests.py`
1. Start Xvfb as display 4: `Xvfb :4 -screen 0 1024x768x24`
1. Run the layout tests in the Xvfb: `DISPLAY=:4 run_layout_tests.py`
## Tiling Window managers
The layout tests want to run with the window at a particular size down to the pixel level. This means if your window manager resizes the window it'll cause test failures. This is another good reason to use an embedded X server.
The layout tests want to run with the window at a particular size down to the
pixel level. This means if your window manager resizes the window it'll cause
test failures. This is another good reason to use an embedded X server.
### xmonad
In your `.xmonad/xmonad.hs`, change your config to include a manageHook along these lines:
In your `.xmonad/xmonad.hs`, change your config to include a manageHook along
these lines:
```
test_shell_manage = className =? "Test_shell" --> doFloat
main = xmonad $
defaultConfig
{ manageHook = test_shell_manage <+> manageHook defaultConfig
...
```
\ No newline at end of file
```
**Note: This page is (somewhat) obsolete.** Chrome has a native 64-bit build now. Normal users should be running 64-bit Chrome on 64-bit systems. However, it's possible developers might be using a 64-bit system to build 32-bit Chrome, and will want to test the build on the same system. In that case, some of these tips may still be useful (though there might not be much more work done to address problems with this configuration).
Many 64-bit Linux distros allow you to run 32-bit apps but have many libraries misconfigured. The distros may be fixed at some point, but in the meantime we have workarounds.
## IME path wrong
Symptom: IME doesn't work. `Gtk: /usr/lib/gtk-2.0/2.10.0/immodules/im-uim.so: wrong ELF class: ELFCLASS64`
Chromium bug: [9643](http://code.google.com/p/chromium/issues/detail?id=9643)
Affected systems:
| **Distro** | **upstream bug** |
|:-----------|:-----------------|
| Ubuntu Hardy, Jaunty | [190227](https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/190227) |
Workaround: If your xinput setting is to use SCIM, im-scim.so is searched for in lib32 directory, but ia32 package does not have im-scim.so in Ubuntu and perhaps other distributions. Ubuntu Hardy, however, has 32-bit im-xim.so. Therefore, invoking Chrome as following enables SCIM in Chrome.
> $ GTK\_IM\_MODULE=xim XMODIFIERS="@im=SCIM" chrome
## GTK filesystem module path wrong
Symptom: File picker doesn't work. `Gtk: /usr/lib/gtk-2.0/2.10.0/filesystems/libgio.so: wrong ELF class: ELFCLASS64`
Chromium bug: [12151](http://code.google.com/p/chromium/issues/detail?id=12151)
Affected systems:
| **Distro** | **upstream bug** |
|:-----------|:-----------------|
| Ubuntu Hardy, Jaunty, Koala alpha 2 | [190227](https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/190227) |
Workaround: ??
## GIO module path wrong
Symptom: `/usr/lib/gio/modules/libgioremote-volume-monitor.so: wrong ELF class: ELFCLASS64`
Chromium bug: [12193](http://code.google.com/p/chromium/issues/detail?id=12193)
Affected systems:
| **Distro** | **upstream bug** |
|:-----------|:-----------------|
| Ubuntu Hardy, Jaunty, Koala alpha 2 | [190227](https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/190227) |
Workaround: ??
## Can't install on 64 bit Ubuntu 9.10 Live CD
Symptom: "Error: Dependency is not satisfiable: ia32-libs-gtk"
Chromium bug: n/a
Affected systems:
| **Distro** | **upstream bug** |
|:-----------|:-----------------|
| Ubuntu Koala alpha 2 | |
Workaround: Enable the Universe repository. (It's enabled by default
when you actually install Ubuntu; only the live CD has it disabled.)
## gconv path wrong
Symptom: Paste doesn't work. `Gdk: Error converting selection from STRING: Conversion from character set 'ISO-8859-1' to 'UTF-8' is not supported`
Chromium bug: [12312](http://code.google.com/p/chromium/issues/detail?id=12312)
Affected systems:
| **Distro** | **upstream bug** |
|:-----------|:-----------------|
| Arch | ?? |
Workaround: Set `GCONV_PATH` to appropriate `/path/to/lib32/usr/lib/gconv` .
\ No newline at end of file
This diff is collapsed.
# Introduction
# Linux — Building and Debugging GTK
Sometimes installing the debug packages for gtk and glib isn't quite enough.
(For instance, if the artifacts from -O2 are driving you bonkers in gdb, you
might want to rebuild with -O0.)
Here's how to build from source and use your local version without installing it.
Here's how to build from source and use your local version without installing
it.
[TOC]
## 32-bit systems
On Ubuntu, to download and build glib and gtk suitable for debugging:
1. If you don't have a gpg key yet, generate one with gpg --gen-key.
2. Create file ~/.devscripts containing DEBSIGN\_KEYID=yourkey, e.g.
DEBSIGN\_KEYID=CC91A262
(See http://www.debian.org/doc/maint-guide/ch-build.en.html
3. If you're on a 32 bit system, do:
```
#!/bin/sh
set -x
set -e
# Workaround for "E: Build-dependencies for glib2.0 could not be satisfied"
# See also https://bugs.launchpad.net/ubuntu/+source/apt/+bug/245068
sudo apt-get install libgamin-dev
sudo apt-get build-dep glib2.0 gtk+2.0
rm -rf ~/mylibs
mkdir ~/mylibs
cd ~/mylibs
apt-get source glib2.0 gtk+2.0
cd glib2.0*
DEB_BUILD_OPTIONS="nostrip noopt debug" debuild
cd ../gtk+2.0*
DEB_BUILD_OPTIONS="nostrip noopt debug" debuild
```
This should take about an hour. If it gets stuck waiting for a zombie,
1. If you don't have a gpg key yet, generate one with `gpg --gen-key`.
2. Create file `~/.devscripts` containing `DEBSIGN_KEYID=yourkey`, e.g.
`DEBSIGN_KEYID=CC91A262` (See
http://www.debian.org/doc/maint-guide/ch-build.en.html)
3. If you're on a 32 bit system, do:
```shell
#!/bin/sh
set -x
set -e
# Workaround for "E: Build-dependencies for glib2.0 could not be satisfied"
# See also https://bugs.launchpad.net/ubuntu/+source/apt/+bug/245068
sudo apt-get install libgamin-dev
sudo apt-get build-dep glib2.0 gtk+2.0
rm -rf ~/mylibs
mkdir ~/mylibs
cd ~/mylibs
apt-get source glib2.0 gtk+2.0
cd glib2.0*
DEB_BUILD_OPTIONS="nostrip noopt debug" debuild
cd ../gtk+2.0*
DEB_BUILD_OPTIONS="nostrip noopt debug" debuild
```
This should take about an hour. If it gets stuck waiting for a zombie,
you may have to kill its closest parent (the makefile uses subshells,
and bash seems to get confused). When I did this, it continued successfully.
and bash seems to get confused). When I did this, it continued successfully.
At the very end, it will prompt you for the passphrase for your gpg key.
Then, to run an app with those libraries, do e.g.
```
export LD_LIBRARY_PATH=$HOME/mylibs/gtk+2.0-2.16.1/debian/install/shared/usr/lib:$HOME/mylibs/gtk+2.0-2.20.1/debian/install/shared/usr/lib
```
export LD_LIBRARY_PATH=$HOME/mylibs/gtk+2.0-2.16.1/debian/install/shared/usr/lib:$HOME/mylibs/gtk+2.0-2.20.1/debian/install/shared/usr/lib
gdb ignores that variable, so in the debugger, you would have to do something like
```
set solib-search-path $HOME/mylibs/gtk+2.0-2.16.1/debian/install/shared/usr/lib:$HOME/mylibs/gtk+2.0-2.20.1/debian/install/shared/usr/lib
```