This commit is contained in:
Wes Kocher 2016-07-07 11:38:52 -07:00
Родитель 7302908ebc 0d557f012a
Коммит b013d99d86
8 изменённых файлов: 164 добавлений и 129 удалений

Просмотреть файл

@ -62,6 +62,8 @@ linkAndAllocate(JSContext* cx, js::jit::MacroAssembler* masm)
return l.newCode<CanGC>(cx, ION_CODE);
}
#define TRY(x) if (!(x)) return false;
BEGIN_TEST(testJitMoveEmitterCycles_simple)
{
using namespace js;
@ -75,20 +77,20 @@ BEGIN_TEST(testJitMoveEmitterCycles_simple)
MoveResolver mr;
mr.setAllocator(alloc);
Simulator* sim = Simulator::Current();
mr.addMove(MoveOperand(d0), MoveOperand(d2), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d0), MoveOperand(d2), MoveOp::DOUBLE));
sim->set_d_register_from_double(0, 2);
mr.addMove(MoveOperand(d3), MoveOperand(d1), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d3), MoveOperand(d1), MoveOp::DOUBLE));
sim->set_d_register_from_double(3, 1);
mr.addMove(MoveOperand(s4), MoveOperand(s0), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s4), MoveOperand(s0), MoveOp::FLOAT32));
sim->set_s_register_from_float(4, 0);
mr.addMove(MoveOperand(s5), MoveOperand(s6), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s5), MoveOperand(s6), MoveOp::FLOAT32));
sim->set_s_register_from_float(5, 6);
mr.addMove(MoveOperand(s2), MoveOperand(s1), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s1), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 1);
mr.addMove(MoveOperand(s3), MoveOperand(s7), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s3), MoveOperand(s7), MoveOp::FLOAT32));
sim->set_s_register_from_float(3, 7);
// don't explode!
mr.resolve();
TRY(mr.resolve());
mover.emit(mr);
mover.finish();
masm.abiret();
@ -116,58 +118,58 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen)
MoveResolver mr;
mr.setAllocator(alloc);
Simulator* sim = Simulator::Current();
mr.addMove(MoveOperand(d9), MoveOperand(d14), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d9), MoveOperand(d14), MoveOp::DOUBLE));
sim->set_d_register_from_double(9, 9);
mr.addMove(MoveOperand(s24), MoveOperand(s25), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s24), MoveOperand(s25), MoveOp::FLOAT32));
sim->set_s_register_from_float(24, 24);
mr.addMove(MoveOperand(d3), MoveOperand(d0), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d3), MoveOperand(d0), MoveOp::DOUBLE));
sim->set_d_register_from_double(3, 3);
mr.addMove(MoveOperand(s10), MoveOperand(s31), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s10), MoveOperand(s31), MoveOp::FLOAT32));
sim->set_s_register_from_float(10, 10);
mr.addMove(MoveOperand(d1), MoveOperand(d10), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d1), MoveOperand(d10), MoveOp::DOUBLE));
sim->set_d_register_from_double(1, 1);
mr.addMove(MoveOperand(s8), MoveOperand(s10), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s8), MoveOperand(s10), MoveOp::FLOAT32));
sim->set_s_register_from_float(8, 8);
mr.addMove(MoveOperand(d2), MoveOperand(d7), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d2), MoveOperand(d7), MoveOp::DOUBLE));
sim->set_d_register_from_double(2, 2);
mr.addMove(MoveOperand(s20), MoveOperand(s18), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s20), MoveOperand(s18), MoveOp::FLOAT32));
sim->set_s_register_from_float(20, 20);
mr.addMove(MoveOperand(s1), MoveOperand(s3), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s1), MoveOperand(s3), MoveOp::FLOAT32));
sim->set_s_register_from_float(1, 1);
mr.addMove(MoveOperand(s17), MoveOperand(s11), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s17), MoveOperand(s11), MoveOp::FLOAT32));
sim->set_s_register_from_float(17, 17);
mr.addMove(MoveOperand(s22), MoveOperand(s30), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s22), MoveOperand(s30), MoveOp::FLOAT32));
sim->set_s_register_from_float(22, 22);
mr.addMove(MoveOperand(s31), MoveOperand(s7), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s31), MoveOperand(s7), MoveOp::FLOAT32));
sim->set_s_register_from_float(31, 31);
mr.addMove(MoveOperand(d3), MoveOperand(d13), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d3), MoveOperand(d13), MoveOp::DOUBLE));
sim->set_d_register_from_double(3, 3);
mr.addMove(MoveOperand(d9), MoveOperand(d8), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d9), MoveOperand(d8), MoveOp::DOUBLE));
sim->set_d_register_from_double(9, 9);
mr.addMove(MoveOperand(s31), MoveOperand(s23), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s31), MoveOperand(s23), MoveOp::FLOAT32));
sim->set_s_register_from_float(31, 31);
mr.addMove(MoveOperand(s13), MoveOperand(s8), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s13), MoveOperand(s8), MoveOp::FLOAT32));
sim->set_s_register_from_float(13, 13);
mr.addMove(MoveOperand(s28), MoveOperand(s5), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s28), MoveOperand(s5), MoveOp::FLOAT32));
sim->set_s_register_from_float(28, 28);
mr.addMove(MoveOperand(s31), MoveOperand(s19), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s31), MoveOperand(s19), MoveOp::FLOAT32));
sim->set_s_register_from_float(31, 31);
mr.addMove(MoveOperand(s20), MoveOperand(s6), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s20), MoveOperand(s6), MoveOp::FLOAT32));
sim->set_s_register_from_float(20, 20);
mr.addMove(MoveOperand(s0), MoveOperand(s2), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s0), MoveOperand(s2), MoveOp::FLOAT32));
sim->set_s_register_from_float(0, 0);
mr.addMove(MoveOperand(d7), MoveOperand(d6), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d7), MoveOperand(d6), MoveOp::DOUBLE));
sim->set_d_register_from_double(7, 7);
mr.addMove(MoveOperand(s13), MoveOperand(s9), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s13), MoveOperand(s9), MoveOp::FLOAT32));
sim->set_s_register_from_float(13, 13);
mr.addMove(MoveOperand(s1), MoveOperand(s4), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s1), MoveOperand(s4), MoveOp::FLOAT32));
sim->set_s_register_from_float(1, 1);
mr.addMove(MoveOperand(s29), MoveOperand(s22), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s29), MoveOperand(s22), MoveOp::FLOAT32));
sim->set_s_register_from_float(29, 29);
mr.addMove(MoveOperand(s25), MoveOperand(s24), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s25), MoveOperand(s24), MoveOp::FLOAT32));
sim->set_s_register_from_float(25, 25);
// don't explode!
mr.resolve();
TRY(mr.resolve());
mover.emit(mr);
mover.finish();
masm.abiret();
@ -216,66 +218,66 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen2)
MoveResolver mr;
mr.setAllocator(alloc);
Simulator* sim = Simulator::Current();
mr.addMove(MoveOperand(d10), MoveOperand(d0), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d10), MoveOperand(d0), MoveOp::DOUBLE));
sim->set_d_register_from_double(10, 10);
mr.addMove(MoveOperand(s15), MoveOperand(s3), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s15), MoveOperand(s3), MoveOp::FLOAT32));
sim->set_s_register_from_float(15, 15);
mr.addMove(MoveOperand(s2), MoveOperand(s28), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s28), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 2);
mr.addMove(MoveOperand(s30), MoveOperand(s25), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s30), MoveOperand(s25), MoveOp::FLOAT32));
sim->set_s_register_from_float(30, 30);
mr.addMove(MoveOperand(s16), MoveOperand(s2), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s16), MoveOperand(s2), MoveOp::FLOAT32));
sim->set_s_register_from_float(16, 16);
mr.addMove(MoveOperand(s2), MoveOperand(s29), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s29), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 2);
mr.addMove(MoveOperand(s17), MoveOperand(s10), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s17), MoveOperand(s10), MoveOp::FLOAT32));
sim->set_s_register_from_float(17, 17);
mr.addMove(MoveOperand(s2), MoveOperand(s19), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s19), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 2);
mr.addMove(MoveOperand(s9), MoveOperand(s26), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s9), MoveOperand(s26), MoveOp::FLOAT32));
sim->set_s_register_from_float(9, 9);
mr.addMove(MoveOperand(s1), MoveOperand(s23), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s1), MoveOperand(s23), MoveOp::FLOAT32));
sim->set_s_register_from_float(1, 1);
mr.addMove(MoveOperand(s8), MoveOperand(s6), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s8), MoveOperand(s6), MoveOp::FLOAT32));
sim->set_s_register_from_float(8, 8);
mr.addMove(MoveOperand(s24), MoveOperand(s16), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s24), MoveOperand(s16), MoveOp::FLOAT32));
sim->set_s_register_from_float(24, 24);
mr.addMove(MoveOperand(s19), MoveOperand(s4), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s19), MoveOperand(s4), MoveOp::FLOAT32));
sim->set_s_register_from_float(19, 19);
mr.addMove(MoveOperand(d5), MoveOperand(d6), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d5), MoveOperand(d6), MoveOp::DOUBLE));
sim->set_d_register_from_double(5, 5);
mr.addMove(MoveOperand(s18), MoveOperand(s15), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s18), MoveOperand(s15), MoveOp::FLOAT32));
sim->set_s_register_from_float(18, 18);
mr.addMove(MoveOperand(s23), MoveOperand(s30), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s23), MoveOperand(s30), MoveOp::FLOAT32));
sim->set_s_register_from_float(23, 23);
mr.addMove(MoveOperand(s27), MoveOperand(s17), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s27), MoveOperand(s17), MoveOp::FLOAT32));
sim->set_s_register_from_float(27, 27);
mr.addMove(MoveOperand(d3), MoveOperand(d4), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d3), MoveOperand(d4), MoveOp::DOUBLE));
sim->set_d_register_from_double(3, 3);
mr.addMove(MoveOperand(s14), MoveOperand(s27), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s14), MoveOperand(s27), MoveOp::FLOAT32));
sim->set_s_register_from_float(14, 14);
mr.addMove(MoveOperand(s2), MoveOperand(s31), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s31), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 2);
mr.addMove(MoveOperand(s2), MoveOperand(s24), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s24), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 2);
mr.addMove(MoveOperand(s31), MoveOperand(s11), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s31), MoveOperand(s11), MoveOp::FLOAT32));
sim->set_s_register_from_float(31, 31);
mr.addMove(MoveOperand(s0), MoveOperand(s18), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s0), MoveOperand(s18), MoveOp::FLOAT32));
sim->set_s_register_from_float(0, 0);
mr.addMove(MoveOperand(s24), MoveOperand(s7), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s24), MoveOperand(s7), MoveOp::FLOAT32));
sim->set_s_register_from_float(24, 24);
mr.addMove(MoveOperand(s0), MoveOperand(s21), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s0), MoveOperand(s21), MoveOp::FLOAT32));
sim->set_s_register_from_float(0, 0);
mr.addMove(MoveOperand(s27), MoveOperand(s20), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s27), MoveOperand(s20), MoveOp::FLOAT32));
sim->set_s_register_from_float(27, 27);
mr.addMove(MoveOperand(s14), MoveOperand(s5), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s14), MoveOperand(s5), MoveOp::FLOAT32));
sim->set_s_register_from_float(14, 14);
mr.addMove(MoveOperand(s2), MoveOperand(s14), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s14), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 2);
mr.addMove(MoveOperand(s12), MoveOperand(s22), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s12), MoveOperand(s22), MoveOp::FLOAT32));
sim->set_s_register_from_float(12, 12);
// don't explode!
mr.resolve();
TRY(mr.resolve());
mover.emit(mr);
mover.finish();
masm.abiret();
@ -329,66 +331,66 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen3)
MoveResolver mr;
mr.setAllocator(alloc);
Simulator* sim = Simulator::Current();
mr.addMove(MoveOperand(s0), MoveOperand(s21), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s0), MoveOperand(s21), MoveOp::FLOAT32));
sim->set_s_register_from_float(0, 0);
mr.addMove(MoveOperand(s2), MoveOperand(s26), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s2), MoveOperand(s26), MoveOp::FLOAT32));
sim->set_s_register_from_float(2, 2);
mr.addMove(MoveOperand(s19), MoveOperand(s20), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s19), MoveOperand(s20), MoveOp::FLOAT32));
sim->set_s_register_from_float(19, 19);
mr.addMove(MoveOperand(s4), MoveOperand(s24), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s4), MoveOperand(s24), MoveOp::FLOAT32));
sim->set_s_register_from_float(4, 4);
mr.addMove(MoveOperand(s22), MoveOperand(s9), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s22), MoveOperand(s9), MoveOp::FLOAT32));
sim->set_s_register_from_float(22, 22);
mr.addMove(MoveOperand(s5), MoveOperand(s28), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s5), MoveOperand(s28), MoveOp::FLOAT32));
sim->set_s_register_from_float(5, 5);
mr.addMove(MoveOperand(s15), MoveOperand(s7), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s15), MoveOperand(s7), MoveOp::FLOAT32));
sim->set_s_register_from_float(15, 15);
mr.addMove(MoveOperand(s26), MoveOperand(s14), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s26), MoveOperand(s14), MoveOp::FLOAT32));
sim->set_s_register_from_float(26, 26);
mr.addMove(MoveOperand(s13), MoveOperand(s30), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s13), MoveOperand(s30), MoveOp::FLOAT32));
sim->set_s_register_from_float(13, 13);
mr.addMove(MoveOperand(s26), MoveOperand(s22), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s26), MoveOperand(s22), MoveOp::FLOAT32));
sim->set_s_register_from_float(26, 26);
mr.addMove(MoveOperand(s21), MoveOperand(s6), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s21), MoveOperand(s6), MoveOp::FLOAT32));
sim->set_s_register_from_float(21, 21);
mr.addMove(MoveOperand(s23), MoveOperand(s31), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s23), MoveOperand(s31), MoveOp::FLOAT32));
sim->set_s_register_from_float(23, 23);
mr.addMove(MoveOperand(s7), MoveOperand(s12), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s7), MoveOperand(s12), MoveOp::FLOAT32));
sim->set_s_register_from_float(7, 7);
mr.addMove(MoveOperand(s14), MoveOperand(s10), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s14), MoveOperand(s10), MoveOp::FLOAT32));
sim->set_s_register_from_float(14, 14);
mr.addMove(MoveOperand(d12), MoveOperand(d8), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d12), MoveOperand(d8), MoveOp::DOUBLE));
sim->set_d_register_from_double(12, 12);
mr.addMove(MoveOperand(s5), MoveOperand(s1), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s5), MoveOperand(s1), MoveOp::FLOAT32));
sim->set_s_register_from_float(5, 5);
mr.addMove(MoveOperand(d12), MoveOperand(d2), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d12), MoveOperand(d2), MoveOp::DOUBLE));
sim->set_d_register_from_double(12, 12);
mr.addMove(MoveOperand(s3), MoveOperand(s8), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s3), MoveOperand(s8), MoveOp::FLOAT32));
sim->set_s_register_from_float(3, 3);
mr.addMove(MoveOperand(s14), MoveOperand(s0), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s14), MoveOperand(s0), MoveOp::FLOAT32));
sim->set_s_register_from_float(14, 14);
mr.addMove(MoveOperand(s28), MoveOperand(s29), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s28), MoveOperand(s29), MoveOp::FLOAT32));
sim->set_s_register_from_float(28, 28);
mr.addMove(MoveOperand(d12), MoveOperand(d9), MoveOp::DOUBLE);
TRY(mr.addMove(MoveOperand(d12), MoveOperand(d9), MoveOp::DOUBLE));
sim->set_d_register_from_double(12, 12);
mr.addMove(MoveOperand(s29), MoveOperand(s2), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s29), MoveOperand(s2), MoveOp::FLOAT32));
sim->set_s_register_from_float(29, 29);
mr.addMove(MoveOperand(s22), MoveOperand(s27), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s22), MoveOperand(s27), MoveOp::FLOAT32));
sim->set_s_register_from_float(22, 22);
mr.addMove(MoveOperand(s19), MoveOperand(s3), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s19), MoveOperand(s3), MoveOp::FLOAT32));
sim->set_s_register_from_float(19, 19);
mr.addMove(MoveOperand(s21), MoveOperand(s11), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s21), MoveOperand(s11), MoveOp::FLOAT32));
sim->set_s_register_from_float(21, 21);
mr.addMove(MoveOperand(s22), MoveOperand(s13), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s22), MoveOperand(s13), MoveOp::FLOAT32));
sim->set_s_register_from_float(22, 22);
mr.addMove(MoveOperand(s29), MoveOperand(s25), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s29), MoveOperand(s25), MoveOp::FLOAT32));
sim->set_s_register_from_float(29, 29);
mr.addMove(MoveOperand(s29), MoveOperand(s15), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s29), MoveOperand(s15), MoveOp::FLOAT32));
sim->set_s_register_from_float(29, 29);
mr.addMove(MoveOperand(s16), MoveOperand(s23), MoveOp::FLOAT32);
TRY(mr.addMove(MoveOperand(s16), MoveOperand(s23), MoveOp::FLOAT32));
sim->set_s_register_from_float(16, 16);
// don't explode!
mr.resolve();
TRY(mr.resolve());
mover.emit(mr);
mover.finish();
masm.abiret();

Просмотреть файл

@ -789,7 +789,8 @@ WebrtcVideoConduit::ConfigureSendMediaCodec(const VideoCodecConfig* codecConfig)
mCurSendCodecConfig = new VideoCodecConfig(*codecConfig);
}
mPtrRTP->SetRembStatus(mChannel, true, false);
bool remb_requested = codecConfig->RtcpFbRembIsSet();
mPtrRTP->SetRembStatus(mChannel, true, remb_requested);
return kMediaConduitNoError;
}

Просмотреть файл

@ -67,9 +67,9 @@ var ActionBarHandler = {
if (this._selectionID) {
if (!this._selectionHasChanged()) {
// Still the same active selection.
if (e.reason == 'visibilitychange' || e.reason == 'presscaret' ||
e.reason == 'scroll' ) {
// Visibility changes don't affect boundingClientRect.
if (e.reason == 'presscaret' || e.reason == 'scroll') {
// boundingClientRect doesn't matter since we are hiding the floating
// toolbar.
this._updateVisibility();
} else {
// Selection changes update boundingClientRect.

Просмотреть файл

@ -132,6 +132,8 @@ function testDownload(callback) {
var url = getUpdateURL();
isnot(navigator.userAgent, UA_OVERRIDE, 'UA already overridden');
info('Waiting for UA update: ' + url);
chromeScript.sendAsyncMessage("notify-on-update");
SpecialPowers.pushPrefEnv({
set: [
[PREF_UPDATES_ENABLED, true],
@ -139,7 +141,10 @@ function testDownload(callback) {
[PREF_UPDATES_TIMEOUT, 10000],
[PREF_UPDATES_INTERVAL, 1] // 1 second interval
]
}, function waitForUpdate() { setTimeout( function() {
});
function waitForUpdate() {
info("Update Happened");
testUAIFrameNoNav(location.origin, UA_OVERRIDE, true, 'Header UA not overridden', function() {
var updateTime = parseInt(getUA('http://example.org'));
todo(startTime <= updateTime, 'Update was before start time');
@ -157,7 +162,9 @@ function testDownload(callback) {
}
})();
});
}, 1500); }); // Timeout should be slightly larger than the update interval.
}
chromeScript.addMessageListener("useragent-update-complete", waitForUpdate);
}
function testBadUpdate(callback) {
@ -208,6 +215,9 @@ const chromeScript = SpecialPowers.loadChromeScript(_ => {
Components.interfaces.nsIObserver).observe(null, "utm-test-init", "");
Components.utils.import("resource://gre/modules/UserAgentOverrides.jsm");
var _notifyOnUpdate = false;
var UAO = UserAgentOverrides;
UAO.uninit();
@ -226,6 +236,15 @@ const chromeScript = SpecialPowers.loadChromeScript(_ => {
const PREF_UPDATES = "general.useragent.updates.";
const PREF_UPDATES_ENABLED = PREF_UPDATES + "enabled";
const PREF_UPDATES_LASTUPDATED = PREF_UPDATES + "lastupdated";
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.addObserver(PREF_UPDATES_LASTUPDATED, () => {
if (_notifyOnUpdate) {
_notifyOnUpdate = false; // Only notify once, for the first update.
sendAsyncMessage("useragent-update-complete");
}
} , false);
var OVERRIDES = null;
@ -297,6 +316,7 @@ const chromeScript = SpecialPowers.loadChromeScript(_ => {
addMessageListener("set-overrides", function(overrides) { OVERRIDES = overrides});
addMessageListener("UAO-init", function() { UAO.init(); });
addMessageListener("UAO-uninit", function() { UAO.uninit(); });
addMessageListener("notify-on-update", () => { _notifyOnUpdate = true });
});
chromeScript.addMessageListener("testProfileSaveDone", SimpleTest.finish);

Просмотреть файл

@ -326,8 +326,8 @@ GeckoDriver.prototype.startBrowser = function(win, isNewSession=false) {
* True if this is the first time we're talking to this browser.
*/
GeckoDriver.prototype.whenBrowserStarted = function(win, isNewSession) {
try {
let mm = win.window.messageManager;
let mm = win.window.messageManager;
if (mm) {
if (!isNewSession) {
// Loading the frame script corresponds to a situation we need to
// return to the server. If the messageManager is a message broadcaster
@ -343,10 +343,9 @@ GeckoDriver.prototype.whenBrowserStarted = function(win, isNewSession) {
mm.loadFrameScript(FRAME_SCRIPT, true, true);
Preferences.set(CONTENT_LISTENER_PREF, true);
}
} catch (e) {
// there may not always be a content process
} else {
logger.error(
`Could not load listener into content for page ${win.location.href}: ${e}`);
`Could not load listener into content for page ${win.location.href}`);
}
};
@ -2265,7 +2264,13 @@ GeckoDriver.prototype.sessionTearDown = function(cmd, resp) {
let winEn = Services.wm.getEnumerator(null);
while (winEn.hasMoreElements()) {
winEn.getNext().messageManager.removeDelayedFrameScript(FRAME_SCRIPT);
let win = winEn.getNext();
if (win.messageManager){
win.messageManager.removeDelayedFrameScript(FRAME_SCRIPT);
} else {
logger.error(
`Could not remove listener from page ${win.location.href}`);
}
}
this.curBrowser.frameManager.removeMessageManagerListeners(

Просмотреть файл

@ -6,6 +6,7 @@ import base64
import hashlib
import imghdr
import struct
import time
import urllib
from unittest import skip
@ -92,6 +93,10 @@ class Chrome(ScreenCaptureTestCase):
'chrome');
""")
self.marionette.switch_to_window("foo")
# there can be a race between opening and registering the window
# and switching to it. Waiting a tiny amount of time is enough not to
# break anything.
time.sleep(0.002)
ss = self.marionette.screenshot()
size = self.get_image_dimensions(ss)
self.assert_png(ss)
@ -198,4 +203,4 @@ class Content(ScreenCaptureTestCase):
el = self.marionette.find_element(By.TAG_NAME, "div")
content = self.marionette.screenshot(element=el, format="hash")
hash = hashlib.sha256(ELEMENT).hexdigest()
self.assertEqual(content, hash)
self.assertEqual(content, hash)

Просмотреть файл

@ -299,7 +299,7 @@ Finder.prototype = {
onFindbarClose: function() {
this.focusContent();
this.enableSelection();
this.highlighter.hide();
this.highlighter.highlight(false);
},
onModalHighlightChange(useModalHighlight) {

Просмотреть файл

@ -196,27 +196,9 @@ FinderHighlighter.prototype = {
found = true;
});
} else {
// First, attempt to remove highlighting from main document
let sel = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
sel.removeAllRanges();
this.hide();
this.hide(window);
this.clear();
// Next, check our editor cache, for editors belonging to this
// document
if (this._editors) {
for (let x = this._editors.length - 1; x >= 0; --x) {
if (this._editors[x].document == doc) {
sel = this._editors[x].selectionController
.getSelection(Ci.nsISelectionController.SELECTION_FIND);
sel.removeAllRanges();
// We don't need to listen to this editor any more
this._unhookListenersAtIndex(x);
}
}
}
// Removing the highlighting always succeeds, so return true.
found = true;
}
@ -278,17 +260,37 @@ FinderHighlighter.prototype = {
},
/**
* If modal highlighting is enabled and the outline + dimmed background is
* currently visible, both will be hidden.
* Clear all highlighted matches. If modal highlighting is enabled and
* the outline + dimmed background is currently visible, both will be hidden.
*/
hide(window = null) {
window = window || this.finder._getWindow();
let doc = window.document;
let controller = this.finder._getSelectionController(window);
let sel = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
sel.removeAllRanges();
// Next, check our editor cache, for editors belonging to this
// document
if (this._editors) {
for (let x = this._editors.length - 1; x >= 0; --x) {
if (this._editors[x].document == doc) {
sel = this._editors[x].selectionController
.getSelection(Ci.nsISelectionController.SELECTION_FIND);
sel.removeAllRanges();
// We don't need to listen to this editor any more
this._unhookListenersAtIndex(x);
}
}
}
if (!this._modal)
return;
if (this._modalHighlightOutline)
this._modalHighlightOutline.setAttributeForElement(kModalOutlineId, "hidden", "true");
window = window || this.finder._getWindow();
this._removeHighlightAllMask(window);
this._removeModalHighlightListeners(window);
delete this._brightText;